Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Pausing VB Code in Microsoft Access 97

  • 31-05-2004 8:58pm
    #1
    Registered Users, Registered Users 2 Posts: 358 ✭✭


    Can anyone tell me how to pause code in Microsoft Access 97?

    Basically im running code on an on click event that opens a form and then runs a complex query.

    Docmd.OpenForm "Form"
    Docmd.OpenQuery "Query"

    The problem im having is that when the button is clicked the form isnt loaded properly because access runs straight into calculating the query and the form is left half loaded until the query is finished calculating. Strange I know!

    So the only solution I can think of is;

    Docmd.OpenForm "Form"
    Pause Code (For 1-2 seconds until form has loaded)
    Docmd.OpenQuery "Query"

    I have searched through access help files but cant find anything that will do the job.

    Any suggestions/ways around this would be greatly appreciated.

    TIA. ;)


Comments

  • Registered Users, Registered Users 2 Posts: 834 ✭✭✭fragile


    Use the Sleep Win32 API call

    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

    Private Sub Command1_Click()
    ' Do something

    ' Pause for 5 seconds
    Sleep 5000

    ' Do something else

    End Sub


  • Registered Users, Registered Users 2 Posts: 358 ✭✭Philbert


    Ah "Sleep"!!

    After trying "Stop" "Pause" "Hold" "Step Out" "Exit"........I knew it was something along those lines!

    Many thanks..


Advertisement