I am creating a database in Access 2013
I have created a Navigation form using the Navigation form tool and called it frmMain
I have added two forms to the tabs on the navigation form called frmClients and frmEmployers
On the frmEmployers form there is a command button (cmdNewRecord) that opens a modal popup form frmAddEmployer
This form allows the user to enter data for a new employer. On this form there is a save button which saves the record and closes frmAddEmployer
What I need to do now is go to the record of the employer I just created. On the save button of the frmAddEmployer form I have tried referencing the frmEmployers form so that I can use the DoCmd.GotoRecord option or the DoCmd.SearchForRecord option to accomplish this
Every one of the lines below generates an error that says the form is not open even though it is.
Is there something special I have to do with these new Navigation Forms. Any help will be greatly appreciated.
I have created a Navigation form using the Navigation form tool and called it frmMain
I have added two forms to the tabs on the navigation form called frmClients and frmEmployers
On the frmEmployers form there is a command button (cmdNewRecord) that opens a modal popup form frmAddEmployer
This form allows the user to enter data for a new employer. On this form there is a save button which saves the record and closes frmAddEmployer
What I need to do now is go to the record of the employer I just created. On the save button of the frmAddEmployer form I have tried referencing the frmEmployers form so that I can use the DoCmd.GotoRecord option or the DoCmd.SearchForRecord option to accomplish this
Every one of the lines below generates an error that says the form is not open even though it is.
Is there something special I have to do with these new Navigation Forms. Any help will be greatly appreciated.
Code:
DoCmd.SearchForRecord acForm, "frmEmployers", "EmployerID=" & EmployerID
DoCmd.SearchForRecord acDataForm, "frmEmployers", "[EmployerID]=" & Me!EmployerID
DoCmd.GoToRecord acDataForm, "[Forms]![frmMain].[frmEmployers]", acGoTo, EmployerID
DoCmd.GoToRecord acDataForm, [Forms]![frmMain]![NavigationSubform], acGoTo, EmployerID
DoCmd.GoToRecord acDataForm, "Forms![frmMain].Form![NavigationSubform].Form[frmEmployers]", acGoTo, EmployerID