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 Mike Lewis 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.

athai

IS-IT--Management
Jan 17, 2001
4
0
0
AU
Hi All,

This may be a simple question, but I am not an experienced Access/VBA person...at the moment I have tab, with the first tab as "Main_Menu". It has an unbound list box, and displays all entries. A command button has been created to add new record on this main menu, which takes you to a form which users enter data.

My question is...is there a way to create a command button in the data entry form which will on click:
1. Take you back to the main menu: and
2. if users have entered data, refresh immediately the list box.

At the moment, i have to exit hte database to refresh.

Thanks a million!
 
This should work

Private Sub button1_Click()
'make sure the new record is saved
docmd.runcommand accmdsaverecord
forms!mainformname!comboboxname.requery
DoCmd.close
End Sub


Mike Rohde
rohdem@marshallengines.com
 
Thank you very much Mike, It worked!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top