Results 1 to 3 of 3
  1. #1
    Datament is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Nov 2023
    Posts
    39

    Help with timing delay for command buttons

    I have an Access form F_GetData with eleven controls which are used for filtering specific information to be appended to another form F_Receiver via a query q_AppendData.


    There are two buttons on form f_GetData cmd1 and cmd2, but only cmd2 is visible (cmd1 sits under cmd2 not visible). On click of the visible cmd2, Cmd1 opens and runs q_AppendData and cmd2 opens another form F_Receiver with the data from q_AppendData.

    I had to make cmd1 not visible because we don't want users to click on too many buttons. When cmd2 is clicked, it also clicks cmd1 without users knowing that. However, I need cmd1 to finish running q_AppendData before cmd2 open F_Receiver. If cmd1 does not find any data to retrieve, I need a message to show that, and the eleven controls to go blank.

    I currently have both buttons visible and functioning properly. but would ask for some guidance if I can time delay cmd2 to let cmd1 complete its operation first.

    I greatly would appreciate suggestions from you. Many thanks.

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,940
    Have you tried using doevents after you call cmd1 and before you run the rest of the code in cmd2? Google to find out more

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,570
    Why not hav ejust the one button?

    When are going to want to run the code in cmd2 and never the code in cmd1?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Replies: 4
    Last Post: 01-20-2017, 08:16 AM
  2. command buttons
    By hijack61 in forum Access
    Replies: 4
    Last Post: 11-19-2011, 04:59 PM
  3. Command Buttons
    By BLD21 in forum Access
    Replies: 2
    Last Post: 05-10-2011, 06:27 AM
  4. Command Buttons
    By Rosier75 in forum Access
    Replies: 3
    Last Post: 03-09-2011, 11:59 AM
  5. Command buttons
    By maintt in forum Forms
    Replies: 3
    Last Post: 08-03-2010, 09:52 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