+ Reply to Thread
Results 1 to 7 of 7

Form already displayed; can't show modally

  1. #1
    Forum Contributor
    Join Date
    11-18-2009
    Location
    Winnipeg
    MS-Off Ver
    Excel 2003
    Posts
    203

    Form already displayed; can't show modally

    I'm not sure what's going on because this was working perfectly yesterday. Below is the code I have for a UserForm. When I click the command button, the message box pops up asking if I want to add another record. When I say NO it works fine...but when I click Yes, I get an error:

    Form already displayed; can't show modally

    I pasted all of the code here, but the message box info is toward the bottom.

    What am I missing? Like I said, this worked perfectly fine yesterday.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Form already displayed; can't show modally

    Is this code in UserForm1? If so do you need to bother Showing the form again?
    If someone has helped you then please add to their Reputation

  3. #3
    Forum Contributor
    Join Date
    11-18-2009
    Location
    Winnipeg
    MS-Off Ver
    Excel 2003
    Posts
    203

    Re: Form already displayed; can't show modally

    This code is in UserForm1.

    Yes, I need to show it again if they need to enter more data.

    Basically they're entering data into the form and clicking Add. Then a message box asks if they have another client's data they need to enter. If they say Yes, I need the form to show again.

  4. #4
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Form already displayed; can't show modally

    But the form is already open, ie you havent closed that form in the code therefore its there already. The message you're getting is telling you that you cant already open a form thats already open. So if you want to enter another record then the user is already there. You may need to blank data out etc to start again instead of opening the form again.

  5. #5
    Forum Contributor
    Join Date
    11-18-2009
    Location
    Winnipeg
    MS-Off Ver
    Excel 2003
    Posts
    203

    Re: Form already displayed; can't show modally

    I hear you...but then something has changed because yesterday this worked and I don't think I changed anything. Is there any way to fix this code so when they say Yes, it refreshes the form so they can start again and enter more data?

    When the user hits Yes, I want the data to blank out, I don't want them to have to do it themselves.

    eta: and the form is there, but I have a message box on top of it that says "Do you want to enter another record?" and the only way to get rid of it is to hit Yes or No. When they hit Yes, they get an error. When they hit No, it unloads the form.

  6. #6
    Forum Contributor
    Join Date
    11-18-2009
    Location
    Winnipeg
    MS-Off Ver
    Excel 2003
    Posts
    203

    Re: Form already displayed; can't show modally

    Got it. I added the code below. Not sure if it was there before and I deleted it or what...but now it's working the way I want:

    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Form already displayed; can't show modally

    In the code for Vba yes, you want to reset the fields to blank, depending on how many and their type this can either be done using a FOR EACH loop eg

    Please Login or Register  to view this content.

    or by simply saying the likes of
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Run time error '400' form already displayed cant show modally
    By baig123 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-08-2014, 04:56 AM
  2. [SOLVED] Conditional Formatting to Show whether the Displayed Number is Rounded
    By sskgintl in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-20-2013, 10:12 PM
  3. Replies: 1
    Last Post: 01-31-2013, 04:18 PM
  4. Can a chart be displayed on a user form ?
    By pninja005 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-12-2006, 09:36 AM
  5. Display a form prior to workbook being displayed
    By pkm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-22-2006, 03:10 PM
  6. Change xl data displayed in a linked form
    By trispirit32 in forum Excel General
    Replies: 0
    Last Post: 07-28-2005, 05:02 PM
  7. [SOLVED] keep form displayed
    By JT in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2005, 05:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1