 |
 |

08-08-2000, 12:10 PM
|
|
|
Dataenvironment refresh?
|
I find that my datareports don't ever reflect changes I make to the database, unless I quit my program and re-run it. Is there a way to refresh the dataenvironment?
Steve
|
|

08-09-2000, 03:56 AM
|
|
Senior Contributor
* Guru *
|
|
Join Date: Mar 2000
Location: Christchurch, New Zealand
Posts: 470
|
|
Re: Dataenvironment refresh?
|
This is actually a known issue (except in Microsoft, I think)
I have an article on it stashed aways somewhere and will post it when I find it.
Alternatively, do a search on the past few months for "Data Report" or "Data Environment" with "Refresh" and look for my user name as I have posted this before.
HTH
|
|

08-09-2000, 11:29 AM
|
|
|
Re: Dataenvironment refresh?
|
Just for the information of anyone else who has had this problem, I thought I'd tell you how I got around it.
Simply put, before I call the datareport, I load the dataenvironment, and then unload it directly after.
Load DataEnvironment1
DataReport1.Show
Unload DataEnvironment1
It has worked for me... If anyone can think of other repercussions this method might have, please tell me.
Steve
|
|

08-10-2000, 12:19 AM
|
|
Senior Contributor
* Guru *
|
|
Join Date: Mar 2000
Location: Christchurch, New Zealand
Posts: 470
|
|
Re: Dataenvironment refresh?
|
Excellent hack. Well done! I haven't heard of this solution before.
Cheers
|
|

09-18-2002, 01:09 PM
|
|
|
|
I was having problems with DataCombos emptying when I closed and reopened the Data Environment. NO LONGER THOUGH!! Awesome...a quick solution to a frustrating problem.
THANKS!
|
|

09-30-2002, 08:31 AM
|
|
Regular
|
|
Join Date: Apr 2002
Location: South Africa
Posts: 54
|
|
|
Hi guys,
I still have the similar problem. My DataReport still shows the old data. Do u think that perhaps VB is taking a while to add in the data to my Access database?
My report is used in a search area, where the user enters some search criteria and the results are displayed. Then it can be printed.
Any assistance will be appreciated!
Tweeg
|
|

09-30-2002, 09:27 AM
|
 |
Junior Contributor
|
|
Join Date: May 2002
Location: Planet VB
Posts: 359
|
|
|
if u are using ado to populate the report, then u might want to requery the recordset...and then display the report...
|
__________________
When the going gets tough, the tough get going!!!
|

10-01-2002, 01:58 AM
|
|
Regular
|
|
Join Date: Apr 2002
Location: South Africa
Posts: 54
|
|
|
Hi
Thanks for the reply. I am using this code to populate the 3 tables on the database (Temp1, Temp2, Temp3):
-----
Dim DB as Database
Set DB = OpenDatabase("C:\LMM\LMM.MDB")
DB.Execute ("Delete * from Temp1")
DB.Execute ("Delete * from Temp2")
DB.Execute ("Delete * from Temp3")
DB.Execute("Insert into Temp1 Select......")
DB.Execute("Insert into Temp2 Select......")
DB.Execute("Insert into Temp3 Select......")
-----
I won't go into detail with the code but I hope u get the gist. Now I have my DataEnvironment based on the 3 temp tables in the database and the DataReport is generated from there.
A few q's arise:
1. How would I refresh this connection?
2. Is this a good way to do this?
3. I know I can use a DataControl but is it ok to have 3 datacontrols on the form - or how can I define a DataControl in code as a variable?
Thanks in advance
Tweeg
|
|

10-01-2002, 05:52 AM
|
 |
Centurion
|
|
Join Date: Sep 2002
Location: Bangladesh
Posts: 118
|
|
The solution is Easy.
Suppose you command name under connectios is command1
The before showing the datrareport please use the following code
Code:
On Error Resume Next
dataenvironment1.rscommand1.requery
datareport1.show
This will solve all your problem. 
|
__________________
Hasin Hayder
http://www.vbsthopoti.cjb.net
Lead Programmer - EvelinDev
Things that are tough takes time - Things that are impossible takes a little more.
|

10-02-2002, 01:20 AM
|
|
Regular
|
|
Join Date: Apr 2002
Location: South Africa
Posts: 54
|
|
|
Thanks for the response Hasin
|
|

10-02-2002, 09:37 AM
|
 |
Junior Contributor
|
|
Join Date: May 2002
Location: Planet VB
Posts: 359
|
|
|
u got to requery any recordset (that populates the report) u have before showing...
|
__________________
When the going gets tough, the tough get going!!!
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|