PDA

Click to See Complete Forum and Search --> : Form and Recordset Refreshing


VB-Mike
Feb 8th, 2000, 01:31 AM
I am using DAO to an Access DB. When my app fires it creates a recordset and fills a form. If a user wants to enter another record they hit an "Add" button which opens another window on top of the main window. The user inputs the data and clicks a button to enter the data and the "Add" form closes bringing the user back to the main screen. The problem arises when they move through the records of the main window. The new record is not there because I load the recordset when the main page opens. How can I pop the "Add" window and then refresh the recordset of the main window when the user inputs the new information? If I can do that then the record that the user just added will appear on the main screen. In other words I need to close the main window and open it back up to refresh the recordset.

Glenn
Feb 8th, 2000, 01:49 AM
You should be able to just run the refresh method of the recordset. You don't need to reload the form.

VB-Mike
Feb 8th, 2000, 01:59 AM
For some reason that does not work, tried it. When the "Add" button is clicked and the info is stuffed into the DB and the main screen is again displayed it is the same, it does not refresh. It is almost like I have to completely close the main screen and re-open it to get the recordset to refresh and show the new data, a real pain.

karunakaran
Feb 8th, 2000, 09:50 AM
This is most common problem every body is facing.I also faced the same problem.
As per your message you are opening another form for the data input .

You Please try this way it may work.
You please open a recordset again to fetch all the records from the database where you had placed the coding for updating the new record, and map it to the corresponding text boxes in the main form. I forgot the coding which I did long before.

Still you need clarification let me know about it. I will try to search for that.

thanks
karun

Just I tried it is working.



[This message has been edited by karunakaran (edited 02-08-2000).]

VB-Mike
Feb 8th, 2000, 07:50 PM
GOT IT WORKING! I changed the value of the form_load to form_activate and that did it. I am a rookie at coding and this is my fist project, guess I lucked out! Hopefully I will not run into any further problems.