Update opened form (1 Viewer)

Pat Hartman

Super Moderator
Staff member
Local time
Today, 15:11
Joined
Feb 19, 2002
Messages
36,419
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.
 

Gismo

Registered User.
Local time
Today, 22:11
Joined
Jun 12, 2017
Messages
1,087
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
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 15:11
Joined
Feb 19, 2002
Messages
36,419
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

Top Bottom