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

Form Refresh 3

Status
Not open for further replies.

gabriellec

Programmer
Mar 20, 2001
19
US
Need a little help with refreshing data on a form. The situation is: Form A is the parent form with a button which launches Form B. After the user enters the information on Form B and closes it (which Form A remains open in the background) I need Form A to refresh.

Anyone have that simple line of code to put in the VBA for Form B?

Thanks.
 
Try this in FormB's Close event

Forms![FormA].Requery
Forms![FormA].Refresh

B-) ljprodev@yahoo.com
Professional Development
MS Access Applications
 

Include one of the following in the Close event of FormB.

[forms]![formA].Refresh ' refresh the data on the form
[forms]![formA].Requery ' requery the data source Terry

X-) "I don't have a solution, but I admire your problem."
 
The refresh/requery works great. Only one issue. When I get back to Form A I go back to the first record. Anyway to keep it at the record I left it in?
 
You have to remember somwhere .bookmark property and, after requerying/refreshing the form, you should set it.
For example:

dim varBookmark as Variant

varBookmark=forms!form_A.bookmark

...


forms!form_A.bookmark=varBookmark

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top