Vb6 Data Report Repeatedly Shows Previous Report

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Aug 2007
Posts: 8
Reputation: genie_ps is an unknown quantity at this point 
Solved Threads: 0
genie_ps genie_ps is offline Offline
Newbie Poster

Re: Vb6 Data Report Repeatedly Shows Previous Report

 
0
  #11
Aug 22nd, 2007
My bad, I have tried to cut and paste but I can't get the right formatting of my code on this message box.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 192
Reputation: plusplus is an unknown quantity at this point 
Solved Threads: 16
plusplus plusplus is offline Offline
Junior Poster

Re: Vb6 Data Report Repeatedly Shows Previous Report

 
0
  #12
Aug 22nd, 2007
After
.delete
try to put
.update
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 8
Reputation: genie_ps is an unknown quantity at this point 
Solved Threads: 0
genie_ps genie_ps is offline Offline
Newbie Poster

Re: Vb6 Data Report Repeatedly Shows Previous Report

 
0
  #13
Aug 22nd, 2007
plusplus,

Thanks for the reply. It didn't work but I caught the idea that the data environment which somehow does the caching of data needs to be updated.

I have been fiddling with the data outside the application using MS Access/VB6 Addins - Visual Data Manager directly. And even reset my PC or manually deletes the records in the table being pointed by the data environment, still the old report data gets retained.

After few days of playing around with all the properties of the data environment, the BEGIN TRANS, COMMIT TRANS and putting a PAUSE using a MSGBOX did the work:

---------------------------------------------------------


'*** Save all data on a daily basis and save to REPODETAILS table
StoreReportDetails dStartDate, dEndDate

'Summarizes data on a weekly basis and save to a REPOSUMMARY table.
StoreReportWeekSummary
'*** Environment using MSjet 4.0 OLE provider with
' SQL command:
' SELECT YearNr, monthnr, weeknr, tagnr, PigAge, pigtype,
' feedcode, feedname,heads, eachmealkg, totalcost,
' totalkg, bags FROM REPOSUMMARY
'------------------------------------------------------


Load dtaEnvPigs


With dtaEnvPigs

'*** Open the dta environment, to prepare begintrans
If .RepoSummary.State = 0 Then
.RepoSummary.Open
End If

'*** Force saving of data by committing transactions

dtaEnvPigs.RepoSummary.BeginTrans
dtaEnvPigs.RepoSummary.CommitTrans

'*** Close the environment after loading***
dtaEnvPigs.RepoSummary.Close

'*** Give the provider sufficient delay time to commit trans.
If MsgBox("Press Ok to continue.", vbOKCancel, "Options") = vbCancel Then
Exit Sub
End If
End With

'***Two reports use this SUB, if isSumReport is true, DataReport1 gets printed.***

If Not isSumReport Then
DataReport1.LeftMargin = 200
DataReport1.ReportWidth = 8865
DataReport1.Width = 9100
DataReport1.Title = IIf(isDiscounted, "Discounted", " ")


If DataReport1.Visible = False Then
DataReport1.Show 1
Else
DataReport4.LeftMargin = 200
DataReport4.ReportWidth = 8865
DataReport4.Width = 9100


If DataReport4.Visible = False Then DataReport4.Show
End If

'*** I don't need this trash anymore, unload it.
Unload dtaEnvPigs

Me.MousePointer = vbNormal
dtaRepoSum.Refresh
End Sub
Last edited by genie_ps; Aug 22nd, 2007 at 9:30 pm.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 8
Reputation: genie_ps is an unknown quantity at this point 
Solved Threads: 0
genie_ps genie_ps is offline Offline
Newbie Poster

Re: Vb6 Data Report Repeatedly Shows Previous Report

 
0
  #14
Aug 22nd, 2007
To All good friends who replied and helped me, thanks a lot.

Qveen72 - God bless the queen. I hope
you found your rightful king.

Rich0001 - May you become richer.


plusplus - May you have more plus'es in your bank account.

God bless you all.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 1
Reputation: klheitz is an unknown quantity at this point 
Solved Threads: 0
klheitz klheitz is offline Offline
Newbie Poster

Re: Vb6 Data Report Repeatedly Shows Previous Report

 
0
  #15
Mar 6th, 2008
Just ran across your post looking for help on something similar.

Have you cleared the 'save old data with report' box on the report file itself?

Open the report, under File // Report Options
there will be a checkbox for "Save Data With Report". If it is checked, uncheck it and see if that fixes the issue.

Thansk
klheitz
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 122
Reputation: cometburn is an unknown quantity at this point 
Solved Threads: 19
cometburn's Avatar
cometburn cometburn is offline Offline
Junior Poster

Re: Vb6 Data Report Repeatedly Shows Previous Report

 
0
  #16
Mar 6th, 2008
hope this thread would help you...

http://www.daniweb.com/forums/thread112160.html
Proud to be Philippine made...
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC