Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing result of query into variable in VBA

Status
Not open for further replies.

asanchez4

Programmer
Joined
Apr 22, 2004
Messages
32
Location
US
I need to execute a query in VBA and depending on the result change the color of a button. I have done this before, but have misplaced my code and can no longer figure it out. Please help.

This is how it worked in the past.

The table is 'Customers' and I have a query "Customer1" that returns the value of the field 'Name' for CustomerID=1.

I stored the results of the query into a variable and then branched according to the value of the variable.

Thanks in advance.
 
If you are using A2K or a later version, see conditional fomatting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top