Consulting

Results 1 to 5 of 5

Thread: How modal forms work

  1. #1
    VBAX Regular
    Joined
    Dec 2008
    Posts
    51
    Location

    How modal forms work

    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.

  2. #2
    VBAX Tutor
    Joined
    Jan 2008
    Posts
    266
    Location
    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

  3. #3
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    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?
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  4. #4
    VBAX Regular
    Joined
    Dec 2008
    Posts
    51
    Location
    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.

  5. #5
    VBAX Regular
    Joined
    Dec 2008
    Posts
    51
    Location
    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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •