Results 1 to 3 of 3
  1. #1
    dccjr's Avatar
    dccjr is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Location
    Colorado Springs, CO
    Posts
    138

    Resuming program execution after a modal window


    I have multiple queries in a Sub located in a public module. Below is one of these query sections. I have inserted comments as to what I would like to happen. I just can't figure out how to resume after each section, if necessary. I am not sure if this can even be accomplished, since modal windows stop program execution.

    Code:
    strIDInfoSQL = "SELECT * FROM IDInfo1 WHERE PartNo = '" & strHomePartNo & "';"
    Set rsIDInfo = CurrentDb.OpenRecordset(sqlIDInfoSQL)
    If rsIDInfo.RecordCount > 1 Then
        DoCmd.OpenForm "MultipleRecordNotice", acNormal
        Forms!MultipleRecordNotice!cbxRecordSelect.RecordSource = strRecordFindSQL
    
    'NEED TO REQUERY BASED ON SELECTION MADE IN THE COMBO BOX IN THE MODAL WINDOW/FORM "MultipleRecordNotice"
    
    Else
        With rsIDInfo
            Forms!DisplayForm!tbxDisWPS = rsIDInfo.WPSNo
            Forms!DisplayForm!tbxDisRev = rsIDInfo.Revision
            Forms!DisplayForm!tbxDisApprovalDate = rsIDInfo.ApprovalDate
            Forms!DisplayForm!tbxDisPQR = rsIDInfo.PQRNo
            Forms!DisplayForm!tbxDisPartNo = rsIDInfo.PartNo
            Forms!DisplayForm!tbxDisApproval = rsIDInfo.Approval
        End With
    End If
    .
    .  'NEED TO RESUME HERE
    .

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Presuming code execution is stopping while the form is open (I use the acDialog argument in OpenForm), it will resume if the form is hidden or closed, so a requery at the point of your comment should work.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Oh, but of course you'll have to find a different way of setting the record source, since that line won't be firing until the same point. I'd probably use OpenArgs.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 03-20-2013, 07:04 AM
  2. Inconsistent Code Execution
    By Paul H in forum Forms
    Replies: 2
    Last Post: 09-19-2011, 10:06 AM
  3. Program a 30-day trial into my Access Program?
    By genghiscomm in forum Programming
    Replies: 1
    Last Post: 05-26-2011, 02:14 PM
  4. VBA + SQL statement creation/execution.
    By Playerpawn in forum Access
    Replies: 3
    Last Post: 05-26-2011, 08:25 AM
  5. Pausing macro execution
    By lupis in forum Programming
    Replies: 3
    Last Post: 06-28-2010, 12:46 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