View Full Version : How modal forms work

03-22-2014, 11:13 PM
I have a program that writes bills for tenants. The user chooses a tenant or a group of tenants from a listbox, then tells it to print. I want it to allow users to scan and possibly edit the bill prior to printing to make sure it is properly laid out. When they say print I switch from the selection sheet to the printout sheet to allow user to see the bill, with a modal form on one side of the sheet which uses buttons to give the user the chance to go to the next one or cancel the process. When I set the modal property to True it doesn't allow any edit to the sheet. When I set it to False it allows the code to continue to run and the whole batch of names is processed immediately. How do I get it to pause to allow the user to run around on the sheet and then at some point opt to go to the next sheet? Sorry for the wordiness, thanks for your help.

03-23-2014, 12:19 AM
I suggest you split the code.
One part is the code to get to the point when the user makes changes, this is userform initialize.
And then at userform close you do the rest.

If that's possible

03-23-2014, 06:41 AM
Are you using Word's MailMerge or printing directly from Excel?

The bill is a simple Fill-In-the-Blanks form, isn't it?

What part is not printing correctly?

03-23-2014, 07:41 PM
This prints directly from Excel. It is fill-in-the-blanks, but the problem is not printing. It's that the form if modal won't let the user do anything else but interact with the form, and if not modal it allows the code to keep going in the background. I'm going to try to do this using a new form rather than a sheet in excel to view/print the bills. Thanks.

03-23-2014, 07:43 PM
That may work. I'll write the bill on a userform rather than on an excel page. Then the user can interact with the form as much as he likes, and when finished hit a button to continue the code. Thanks.