Command My Button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Presto731
    New Member
    • Jul 2007
    • 53

    #1

    Command My Button

    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.
    Thanks
  • Carl Witte
    New Member
    • Dec 2006
    • 37

    #2
    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_o r_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)

    Comment

    Working...