I've researched how to call a function stored in another form in Access, but so far none of the suggestions I've read work for me. I'm not sure what I'm doing wrong.
I've created a form1 where the user selects checkboxes and then they can click on a print button. That print button opens a form2 I created which contains a combo box for the list of printers and another print button.
When the user clicks on the print button in Form2 what should happen is that the printer name selected by the user is passed back to the first form and then the first form will execute a function containing the code to print the report using the selected printer.
One of the suggestions I read was to put the function in a module, but I can't do that because the function is tied to many controls and variables in the form which would not be available in the module. I've already declared the function as public but it is inside the Form1.
In Form2 I have tried Call Form_Form1.FunctionName and also Call Forms!form1.functionName which have been suggested by other people, but I get the "object required" error message at runtime because Access can't find the Function I am referring to.
Any suggestions?
I've created a form1 where the user selects checkboxes and then they can click on a print button. That print button opens a form2 I created which contains a combo box for the list of printers and another print button.
When the user clicks on the print button in Form2 what should happen is that the printer name selected by the user is passed back to the first form and then the first form will execute a function containing the code to print the report using the selected printer.
One of the suggestions I read was to put the function in a module, but I can't do that because the function is tied to many controls and variables in the form which would not be available in the module. I've already declared the function as public but it is inside the Form1.
In Form2 I have tried Call Form_Form1.FunctionName and also Call Forms!form1.functionName which have been suggested by other people, but I get the "object required" error message at runtime because Access can't find the Function I am referring to.
Any suggestions?