Results 1 to 5 of 5
  1. #1
    Paul1 is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    50

    Question Code steps through procedure too fast, user selection from listbox on another form is not activated

    Hello,

    I don't have time now to provide a specific example but I am trying to execute a procedure which is called in a form. The form does the following steps:
    1. It calls a list box which opens in another form.
    2. The user is required to select a row from this list box which then enters a new record in a table.


    3. The calling form then runs a procedure in another module in the same form that does some further processing and saves changes to any records in the calling form.

    The problem is that step 3 is never executed. The code runs too fast. In step 2, the list box is only displayed after all the code in the calling procedure is already executed.

    I would appreciate if someone could suggest an approach to solve this. I may well have time tomorrow to provide a sample db if needed.

    Many thanks.

  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,518
    Sounds like the form opened in step one needs to be opened with acDialog, which will stop further code from running until that form is either closed or hidden.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Or move part 3 code to form 2 so that a suitable event on that form does the required processing (such as the form close event)?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    Paul1 is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    50
    That's great. acDialog fixes it. I didn't know about this property before this. Thanks very much to both of you.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help!
    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: 3
    Last Post: 01-20-2017, 02:25 PM
  2. Code skips over certain steps
    By mejia.j88 in forum Programming
    Replies: 8
    Last Post: 03-03-2014, 01:55 PM
  3. Replies: 1
    Last Post: 09-10-2012, 11:21 PM
  4. details form open from listbox selection
    By accesshelpme in forum Access
    Replies: 9
    Last Post: 05-18-2012, 10:50 AM
  5. Replies: 1
    Last Post: 02-01-2012, 11:27 PM

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