SteveL13
asked on
How refresh/requery combobox on 1st form when 2nd form closes
I have a combobox on form 1 which the user uses to select a record to open form 2. When form 2 closes via a command button I want the records in the combobox on form 1 to be requeried.
How can I do this?
--Steve
How can I do this?
--Steve
In the code of your Command Button in form 2 that closes the form, add:
Edit... same as Jeff posted above.
Forms!NameOfForm1!NameOfCo mbobox.Req uery
Edit... same as Jeff posted above.
ASKER
I am so sorry... I forgot one thing. There will be times when form 1 isn't open. So the code has to check for that first.
??
??
Here you go:
If CurrentProject.AllForms("N ameOfForm1 ").IsLoade d = True Then
Forms!NameOfForm1!NameOfCo mbobox.Req uery
End If
If CurrentProject.AllForms("N
Forms!NameOfForm1!NameOfCo
End If
ASKER
Hmmm, that didn't work. When I got back to form 1 the records in the combobox were not requeried.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Steve,
1. Ron's coding looks solid...
(silly question, did you substitute your actual object names in his code...?)
;-)
2. Make sure you code is actually "adding" this value to the underlying table...
For example, if you run Ron's code, ...immediately open the *Table* that stores this value, ...is the value added?
JeffCoachman
1. Ron's coding looks solid...
(silly question, did you substitute your actual object names in his code...?)
;-)
2. Make sure you code is actually "adding" this value to the underlying table...
For example, if you run Ron's code, ...immediately open the *Table* that stores this value, ...is the value added?
JeffCoachman
Forms!Form1!YourCombobox.R