I have a module with a public Sub routine to export data from a query to Excel. Owing to the codes requried to set up the resulting spreadsheet for printing, the exporting process takes about 15 seconds. I intend to run a pop up form while the process is running, alerting users to wait and the form to close when the process is completed. Message on the status bar is not obvious enough to our users, some of which are not very computer literate. Adding a alert message box will do but I see it as a secondary option.
When users click a button on the main menu, I want to open a pop up form and at the same time run the routine to export data to Excel. Since I have to pass a variable from the main menu to the Sub routine, I can either open the form but not able to trigger the Sub or start the Sub without opening the form, depending on how I manipulate the click button action.
1) Open a pop up form - Use docmd command to open the form and pass varible via OpenArgs. In the form load event of the pop up form, retreive the OpenArgs value and pass it to the calling Sub. But it only opens the pop up without running the Sub.
2) Call the Sub directly but include open form command in the Sub procedures. In this case, codes run to build the Excel spreadsheet without opening the pop up form.
I tried to search the forum but did not seem to find anything close to my need. I wonder if any expertise out there can help.
Thanks
When users click a button on the main menu, I want to open a pop up form and at the same time run the routine to export data to Excel. Since I have to pass a variable from the main menu to the Sub routine, I can either open the form but not able to trigger the Sub or start the Sub without opening the form, depending on how I manipulate the click button action.
1) Open a pop up form - Use docmd command to open the form and pass varible via OpenArgs. In the form load event of the pop up form, retreive the OpenArgs value and pass it to the calling Sub. But it only opens the pop up without running the Sub.
2) Call the Sub directly but include open form command in the Sub procedures. In this case, codes run to build the Excel spreadsheet without opening the pop up form.
I tried to search the forum but did not seem to find anything close to my need. I wonder if any expertise out there can help.
Thanks