Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Passing a Value to a Function with a Button (Access 2000 Win 2000 SR-1)

    This should be easy but I'm getting lost in the Object Browser jungle...

    I have a general Function and want to pass a parameter to the function using a button (actually there will be 6 different values depending on the button clicked). I can set up the function to use a variable with the specific value needed, change the value of the variable manually, etc. -- that all works. How do I get a Button to find and load the variable in the Function when clicking thereon?

    TIA

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Passing a Value to a Function with a Button (Access 2000 Win 2000 SR-1

    Is this an option group, or are the buttons individual command buttons? In the first case, you can use a SelectCase function to determine which value the parameter should have. In the second case, the simplest approach would be to have event procedures for each button that invoked the general function with the correct parameter.
    Wendell

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Passing a Value to a Function with a Button (Access 2000 Win 2000 SR-1

    actually i was planning to use a series of buttons (and may even grow the form as more are chose) but how do you invoke the function iz whut i want to know.

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Passing a Value to a Function with a Button (Access 2000 Win 2000 SR-1

    Do you mean the syntax for calling a function? If so, it looks like
    <font color=blue><pre>MyVariable = MyFunction(MyParameter)</pre>

    </font color=blue>
    Wendell

  5. #5
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    austin, Texas, USA
    Posts
    1,029
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Passing a Value to a Function with a Button (Access 2000 Win 2000 SR-1

    thanks -- i knew this was an easy question, just wasn't able to find the right code fragment.

Posting Permissions

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