Pass a value from a button to a query

T

tshipshape

I need to know how to pass a value from a button to a query. A form is shown
to the user with numerous objects on the form. A transparent button is hidden
behind each object. When the user clicks on an object I need the value of
that button passed to the query.
 
J

John Vinson

I need to know how to pass a value from a button to a query. A form is shown
to the user with numerous objects on the form. A transparent button is hidden
behind each object. When the user clicks on an object I need the value of
that button passed to the query.

A Button doesn't have a "value". Do you mean the name of the button?
or some other property of the button?

Also, a Query isn't sitting there waiting for you to "pass" values to
it.

What you may need to do is write VBA code in the Click event of each
button to modify the value of a SQL string, which *is* the query. When
you've made all the modifications you would then open or execute the
query.

Could you explain the structure of this query, and give an example of
what the buttons should do?

John W. Vinson[MVP]
 
Top