MeldrethMan
Technical User
I'm using a command button on a Client form to move to a second form that displays the current option lists for a number of combos on the Client form and its Jobs subform. Each combo's NotInList event just instructs the user to do this.
The second form has this update/close procedure
Private Sub UpdateDropDowns_Click()
'If Client form isn't loaded just exit
If CurrentProject.AllForms("frmClients").IsLoaded = False Then
DoCmd.Close acForm, "frmDropDownMaintenance", acSaveYes
Exit Sub
End If
'Otherwise requery all combos on Client form
Dim frm As Form, sfm As Form
Dim ctl As Control
Set frm = Forms!frmClients
Set sfm = frm!sfmJobs.Form
For Each ctl In frm.Controls
If ctl.Tag = "cbx" Then ctl.Requery
Next
For Each ctl In sfm.Controls
If ctl.Tag = "cbx" Then ctl.Requery
Next
DoCmd.Close acForm, "frmDropDownMaintenance", acSaveYes
Set sfm = Nothing
Set frm = Nothing
End Sub
This works fine except that the Client form has now jumped back to the one that appears on first opening it. This is just an irritation. How can I prevent it?