Hello,
I change a certain field in my MS-Access data-base from the program. Then I click on my "Show Query" button. It shows a new form with DataGrid (which is connected to Data-Envirement). However the data I see is old (not updated). Only if I restart the program I see the changes. How can I refresh the query (I thing I should update a command in the Data-Envirement but I don't know how).
Please check your suggestion before sending it.
Once I get a working answer, I will accept it.
Thanks in advance.
Slava.
--------------------------
If you collect MP3 files, visit my web-page:
http://www.organizermp3.com
http://www.a1vbcode.com/vbtip.asp?ID=39
The DataGrid control is a great way to display multiple data rows in a table-like format. Unfortunately, the control is also plagued with bugs. Some have been fixed by Service Patch 3, but some haven't. For instance, if you connect the DataGrid to a DataEnvironment, then make changes to the underlying recordset and refresh the DataGrid with the Refresh method, the control still doesn't reflect the changes. Unfortunately, the Refresh method doesn't work when the control's DataSource is a DataEnvironment. Instead, to show the updated recordset changes, first update the DataEnvironment's recordset, then rebind the DataGrid to the DataEnvironment. So, if you have a Refresh button, it's click event might look like this:
DataEnvironment1.rsCommand
Set DataGrid1.DataSource = DataEnvironment1
Now, when you click the Refresh button, the code rebinds the DataEnvironment to the DataGrid and refills the control with the refreshed data.
Cheers,
T