Results 1 to 5 of 5
  1. #1
    lawdy is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jan 2013
    Posts
    172

    Pop up form does not stop to allow imput

    The code does not stop when the pop up form opens. I don't get to make a choice until all the code stops running.
    The pop up form is called puHowToBill. The code behind the form is:


    Private Sub popupHowToBill_Click()
    pubLngGen = popupHowToBill ' name of option group holding option buttons
    Debug.Print "pubLngGen " & pubLngGen
    DoCmd.Close
    End Sub

    Then I have a button (on a separate form) to open the pop up form:

    Private Sub btnOpenPopUp_Click()


    DoCmd.OpenForm "puHowToBill"
    Select Case pubLngGen
    Case 1
    MsgBox "You have chosen 'Regular Mail'"
    Case 2
    MsgBox "You have chosen 'Email'"
    Case 3
    MsgBox "You have chosen '3rd Party'"
    Case 4
    MsgBox "You selected to skip setup"
    End Select
    End Sub

    On the pop up form (which I will try to attach) Pop Up is set to YES and Moday is set as YES.
    How can I make it stop for input?

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Remove this line: DoCmd.Close
    Use some other method to close the form, such as its own close button or one that you add to click to close.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    lawdy is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jan 2013
    Posts
    172
    Ok, i removed the line DoCmd.Close and added a button on the pop up form:

    Private Sub btnClose_Click()
    DoCmd.Close
    End Sub

    The code still don't pause to let me make a choice. Once the code finishes the 'select case', then I can make a choice. But that is too late.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    DoCmd.Close has nothing to do with closing "puHowToBill". It's closing whatever form the first button is on.

    Use acDialog parameter. This will suspend code execution on calling form until popup is closed:

    DoCmd.OpenForm "puHowToBill", , , , , acDialog

    Or put the Select Case code behind the popup.



    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    lawdy is offline Competent Performer
    Windows 7 32bit Access 2013
    Join Date
    Jan 2013
    Posts
    172
    Thank you June 7. That works like a charm.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 12-18-2012, 10:00 AM
  2. Imput Mask problem (TEXT)
    By Danzig in forum Forms
    Replies: 3
    Last Post: 10-28-2010, 06:47 PM
  3. update a form with user's imput
    By nianko in forum Forms
    Replies: 3
    Last Post: 08-25-2010, 08:52 AM
  4. Replies: 2
    Last Post: 11-29-2009, 12:00 PM
  5. Issue with conditional imput
    By Estyl in forum Forms
    Replies: 2
    Last Post: 02-19-2008, 10:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums