Update opened form

I'm sorry that you are using separate "add" forms. That makes extra work and requires duplicating the validation code assuming you bother with any.

You can always reference one specific open form from another but the form running the reference code needs to first determine if the form is open. My suggestion always works.
 
I'm sorry that you are using separate "add" forms. That makes extra work and requires duplicating the validation code assuming you bother with any.

You can always reference one specific open form from another but the form running the reference code needs to first determine if the form is open. My suggestion always works.
Hi,

I dont have seperate forms, I was refering to the one signel form for customers, suppliers, which are accesseable from a few menues
only when i raise a purchase order and i need to add a supplier, i open the same suppliers form and when it closes, it needs to auto update the dropdown in the purchases form
When I open the suppliers form anywhere else in the menus, it should not look at the purchase form suppliers drop down

I managed that with the below code

Dim ctlCombo As Control

If CurrentProject.AllForms("Purchase").IsLoaded = True Then
DoCmd.RunCommand acCmdSaveRecord
Set ctlCombo = Forms!Purchase!SupplierID
ctlCombo.Requery
DoCmd.Close , ""
Else
DoCmd.Close , ""

End If
 
it needs to auto update the dropdown in the purchases form
No it doesn't. If you follow my directions, the calling form will requery the dropdown when the modal form closes.
 

Users who are viewing this thread

Back
Top Bottom