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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing data

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a form with an add form button (that takes me to another form to add data) on it. After I go into the add form and put in my data and then exit the add form back to my main form I have to refresh the form to see the latest data. I tried several versions of close events refresh and was hoping to get guidance on how I can get an automatic refresh on the main form after adding.
 
I just use a refresh button on the original page as you are doing. I'd like to know if there's an auto-refresh as well.
 
For First prob try this:-

Within the 'on click' event of the button that closes the 'Add info' form put in :-

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

(this will firstly save the record, then put

docmd.close
docmd.open acform, [MainFormName]

(this will close & re-open the form in one go and refresh the records)

For the second question-
You can set an auto refresh in the timer event of the form (say every 10 secs):-

set Timer interval to 10,000 (10 secs)

then put into 'On Timer' event:-

docmd.requery

(this refreshes the form)


 
But, if you do it that way (close and reopen form) you will lose the data that the user has already entered into the form... isn't there a better way?
 
No, steve said he's using a seperate form to submit records.

If your using the same form just put in:-

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
docmd.requery
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top