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

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Passing a Value to a Function with a Button (Access 2000 Win 2000 SR-1)

    • This topic has 4 replies, 2 voices, and was last updated 22 years ago.
    Author
    Topic
    #389038

    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

    Viewing 0 reply threads
    Author
    Replies
    • #685625

      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.

      • #685627

        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.

        • #685635

          Do you mean the syntax for calling a function? If so, it looks like

          MyVariable = MyFunction(MyParameter)

          • #685650

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

    Viewing 0 reply threads
    Reply To: Passing a Value to a Function with a Button (Access 2000 Win 2000 SR-1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: