|
-
Jul 22nd, 2003, 08:41 AM
#1
Thread Starter
New Member
Refrech Data Report
I face a problem where for the first time I display my report all it was alright but after I went back and add some records to my database, I went back to show again the reports and it seem that same like previous one where the change no effect on it. It only take changed when I close the form few time or close the program and open it again. How do I make the report refresh or updated first before is display the records from the table ???
shinyo21
-
Jul 23rd, 2003, 03:07 AM
#2
New Member
Try to unload dataenvironment and set it nothing in the datareport_queryclose event.
I had this same problem before and what i did is unload the data environment and set it to nothing in the datareport queryclose event and it works fine for me.
Hope this works for you.
-
Jul 23rd, 2003, 06:52 AM
#3
Thread Starter
New Member
-
Jul 23rd, 2003, 07:23 AM
#4
Fanatic Member
Try in queryclose event:
dataenvironment1.rsCommand1.Close
or, another way:
Private Sub Command1_Click()
If DataEnvironment1.rsCommand1.State = adStateOpen Then DataEnvironment1.rsCommand1.Close
'reopen the command
DataEnvironment1.Command1
DataReport1.Show
'allows a refresh with new data without having to close the report first.
DataReport1.Refresh
End Sub
VB 6.0, Access, Sql server, Asp
-
Jul 24th, 2003, 06:26 AM
#5
Thread Starter
New Member
-
Jul 25th, 2003, 08:28 AM
#6
Lively Member
Remember you Datareport is binded to some Recordset data, you must first Requery the recordset and then after you can refresh the DataReport.
In you case you Data comes from DE, try and refresh the DE first then you DataReport.
Regards
Wizard
SA
-
Jul 26th, 2003, 08:40 AM
#7
Thread Starter
New Member
I really sorry, do u have any sample command as what as mention ? I am quite dummy and not quite understand ....
shinyo21
-
Jan 24th, 2006, 03:08 AM
#8
Junior Member
Re: Refrech Data Report
 Originally Posted by shinyo21
I face a problem where for the first time I display my report all it was alright but after I went back and add some records to my database, I went back to show again the reports and it seem that same like previous one where the change no effect on it. It only take changed when I close the form few time or close the program and open it again. How do I make the report refresh or updated first before is display the records from the table ???
shinyo21
dear shiny,
do as follows...
on a commandbutton write this code:
---------------------------------
unload dataenvironment1
datareport1.show
----------------------------------
this will first unload the dataenvironment and automatically reload. Hence this will refresh the datareport and you will get all newly added records in it. OK?
-
Jan 24th, 2006, 03:15 AM
#9
Re: Refrech Data Report
 Originally Posted by sunilmaloo2003
dear shiny,
do as follows...
on a commandbutton write this code:
---------------------------------
unload dataenvironment1
datareport1.show
----------------------------------
this will first unload the dataenvironment and automatically reload. Hence this will refresh the datareport and you will get all newly added records in it. OK?
Are you aware that the thread you are replying to is from year 2003? Anyway, welcome to VBF!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|