Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2007
    Posts
    40

    Unanswered: Opening a form during a function and then waiting for it to finish functioning

    I am working on a fairly complex search system for my database. I want to have a search results box pop up during the execution of a function, and then wait for the user to select a result before the function continues. My first idea was to do something like this:

    Code:
    ' (ResultsFormOpen is a global integer)
    
    Public Function DoFind As Integer
      ' {Do some processing}
      ResultsFormOpen = 1
      Do While (ResultsFormOpen = 1)
      Loop
    End Function
    
    ' ...
    
    Public Sub frmResults_Close
      ResultsFormOpen = 0
    Exit Sub
    But, I find that due to the infinite loop created above, the user does not have any CPU time to actually use the results form, it just freezes on the screen and the application crashes. Is there a better way to do this? I am thinking something along the lines of the FileDialog.Show method, but I'm not sure how this is done.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Check the openform method. You can specify how a form is opened. You want acModal (or acDialog - I forget which). If you look it up in help you will get the correct syntax.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Jun 2007
    Posts
    40
    Quote Originally Posted by pootle flump
    Check the openform method. You can specify how a form is opened. You want acModal (or acDialog - I forget which). If you look it up in help you will get the correct syntax.
    Thanks, that seemed to work.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •