Results 1 to 3 of 3

Thread: Call a button

  1. #1
    Join Date
    Mar 2005
    Posts
    55

    Exclamation Unanswered: Call a button

    I wish to call the function of a command button on another form. How do i do this?

    I tried declaring the sub as public

    and using the code

    call cmdOpenForm()

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Couple of things:

    The form HAS TO BE OPEN to make the call...

    Calling the sub on the form will act on that form's button ...

    If you want a proc to act for your form, it has to be in that form's space or in a module ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Write the command as a public function in a module.
    Code:
    Public Function MyFunctionName()
    ....DoStuff
    End Function
    
    'Call the function like so
    Call MyFunctionName
    George
    Home | Blog

Posting Permissions

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