I have a main form (Add_Member_Person_MemberDB) with combo box in header with a query that lists all records (members). When a record is selected a subform in the detail section lists all the records (i.e. events) associated with the selected record (member).
There is a button in the header of form to "Add new member" which brings up a data entry form (frmNewMember). Both forms are working properly. However when I return to the main form the new record (member) is missing from the combo box in the header.
If I close the main form and reopen it manually the new record (member) appears as the query is executed. So I added VBA code to close the main form on the frmNewMember form "on load" event:
DoCmd.Close acForm, "Add_Member_Person_MemberDB". Then I reopen the main form when I exit the data entry form.
The DoCmd.Close... wasn't working so I tried to execute the command in the Immediate window. The following open form command worked:
DoCmd.OpenForm "Add_Event_Person_MemberDB"
....but the
DoCmd.Close acForm, "Add_Member_Person_MemberDB"
does not.
When I try the same open and close DoCmd commands with the frmNewMember form in the Immediate windows it opens and closes fine.
Any thoughts or suggestions on what is happening or alternative approaches?