By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,027 Members | 1,313 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,027 IT Pros & Developers. It's quick & easy.

Command My Button

P: 53
I have a query that has the information on 35 different stores, each has their own id. I want to make a form that has a map of the USA and each store will have a button and I can click it to open the queery record on that store.

My question is how do I apply that filter to my button so it oinly opens the correct queery record. Do I need seperate macros for each/ Can I apply the filter in the on click property. I tried to wirte the expression but came up empty.

the query is called USA and teh field that has the ID is facility. Any help is appreciated.
Aug 9 '07 #1
Share this Question
Share on Google+
1 Reply

P: 37
What I would do if I were you is build a query for one specific location. Steal the SQL under the SQL view. Since each click is its own button (under VBA code), all you have to do is change the ID='STORECODE' for each. Don't forget in your SQL you'll have to reformat it all to go on one line and make sure what was in quotation marks is under appostrephes (sp). The entire thing make sure is one string and run with docmd.runsql SQL_statement_or_string_here"

If you switch to a combo box you can have a hidden column that has your Storecode in it and call that with your SQL statement. (supercool but harder)
Aug 9 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.