Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data Environment and Reports

Status
Not open for further replies.

goatsaregreat

Programmer
Mar 21, 2001
82
0
0
GB
I have an app that uses a Data Environment(DE) and a Data Report(DR). The DE is tied to an Access DB table that has all of the records deleted from it on a command button click. Then records are added via user-defined stipulations on another table in the same DB. It is just a summary of info. My problem is.. when I run the DR, it works fine. If I close the DR, change the info stipulations, and run the DR again, the first summary is still there. It seems like the DE is not seeing the changes in the DB table. Is there any way to update the DE or maybe there is some other answer? TIA for your help.

PS. The DR runs correctly if I end the program and run it again, but it only will run once.
 
hi..
just add a command before showing the dr. the command is

DE.<command name>

command name is the command which u configure to connect to the access. it is a sub tree of the DE.connection1.<commands>

and u r done... it will solve ur problem.... reply me is ur problem is solved... i will be obliged...

Good Luck
Varnit
 
I tried that, but I got an error message saying, &quot;Operation is not allowed when the object is open.&quot; Clicking &quot;debug&quot; takes me right to the line of code, &quot;dataenvironment1.command1&quot; Any further help will be appreciated. Thanks
 
Well that error raise 'cause you have the command object open. You must close that command when you close your data report: Like this.

Private Sub DataReport_Terminate()
DataEnvironment.rsCommand1.Close
End Sub

You have to add that code in the CODE AREA in your Data Report section.

I Hope it works for you

Mago
 
I still get the same error on that line of code. I deleted that line and tried it, and the DR &quot;refreshes&quot; every other time I run it. So if I run the summary, write the data to the table, and click the button to show the DR, it shows the data from the summary before. If I close the DR, and click the button to show it again, the data is correct. This happens every time. It takes two &quot;tries&quot; to get the data correct. Please help, this does not make any sense to me.
 
I know that it isn't the best you can do but, why don't you just explicitely call .Requery ?
forgive my English, please
masi

 
When I tried that, I got an error message saying, &quot;Operation is not allowed when the object is closed.&quot; I tried putting &quot;dataenvironment1.rscommand1.open&quot; in front of the .requery command, but then I got an error message on the .Open line of code saying, &quot;Operation is not allowed when the object is open.&quot; I do not understand this. There must be some way to refresh the Data Environment. Please continue to make suggestions. TIA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top