Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pause Code Execution While form is open

Status
Not open for further replies.

mustardxhead

Technical User
Oct 18, 2006
8
US
I am developing a module that will generate a MSWord Document from either Database information or user input information that will be run from a switchboard. I am stuck on getting the code to pause while one of the data input forms is open. I have tried locking the code into a loop until the form is closed but that causes resource issues or fails. I am open to other methods of fixing this issue but as of now I am currently looking for a "sleep" method to pause execution of the remaining code till the data has been collected. There is a function call in the close procedure from the form that sets the formOpen variable to false so that the loop will break.

Code:
Sub getNewUser()

    Dim formOpen As Boolean
      
    MsgBox "New User Call Successful"
    DoCmd.OpenForm "BuildNewUserForm", acNormal
    formOpen = True
    
    While formOpen
    
     
        DoEvents
    
    Wend

End Sub
 
DoCmd.OpenForm "BuildNewUserForm", acNormal, , , , acDialog

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
This code worked great for one instance of the application. At a similar step it is required that I be able to open a search box. Because this method opens the form as a dialog it locks control to that form only. I need to stop the processing and still be able to open additional boxes from the primary form. Are there any other solutions out there?
 
mustardxhead,
What do you mean by 'open a search box'? Would this be a form with search-criteria fields on it? Would this form need to be open at the same time as the other dialog form that's open , or could the search form open from the dialog form?
--Jim
 
The intention was to have the dialog form open the search form (standard MS Access Search Box). My work around for this was to have the Sub call a form open and then end. On closing of the form that would call the next Sub to continue the processing. This eliminated any continuation of processing and a need to stop it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top