Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2004
    Posts
    5

    Exclamation Unanswered: Calling functions

    Is it possible to call a function from within a function but not wait for the called function to complete before completing the orriginal function? In other words Function1 calls Function2, but Function1 doesn't wait for Function2 to complete so Function1 may finish before Function2.

    Eric

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by Eric Michaud
    Is it possible to call a function from within a function but not wait for the called function to complete before completing the orriginal function? In other words Function1 calls Function2, but Function1 doesn't wait for Function2 to complete so Function1 may finish before Function2.

    Eric
    Yes ...

    Call SomeFunctionHere
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Quote Originally Posted by M Owen
    Yes ...

    Call SomeFunctionHere
    Could you please provide an example?

    Thank You.
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  4. #4
    Join Date
    Jul 2004
    Posts
    5
    I have tried using Call <someFunction>, for example:
    Private Sub Function1()
    Call Function2
    MsgBox("Done")
    End Sub

    Private Sub Function2()
    <Perform some time consuming task>
    End Sub

    In the example above, the MsgBox("Done") will not execute until Function2 has completed. What I want to do is have MsgBox("Done") execute while Function2 is running (not wait for Function2 to complete).

    Eric

  5. #5
    Join Date
    Dec 2003
    Posts
    268

    You can't do that

    Not in VBA. That is multithreading and you can only do that in .NET applications.

  6. #6
    Join Date
    Jul 2004
    Posts
    5
    Although disappointing, thanks for the info!!

    Eric

  7. #7
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by mjweyland
    Not in VBA. That is multithreading and you can only do that in .NET applications.
    Not exactly true ... In the poster's instance yes he cannot (and Eric it would have been nice for you to give more info ...) because he's using/in the same call stack. If you were say in the midst of say an event (NotInList for example) and issued a Call like I exampled, it would work ... (Actually it does because I do that very thing).
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

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