Link to home
Start Free TrialLog in
Avatar of Dennis Matthews
Dennis Matthews

asked on

Loop through query with variables from table

I have a locations and Sales table.

LocationID  Location Name
1,  Philadelphia
2, Boston
3, Miami
4, Denver


I need VBA that will use the following query Select * From Sales where S_LocationID=? and loop through all the locations and save a separate excel file with the sales from each location
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dennis Matthews
Dennis Matthews

ASKER

I think that worked but get a mismatch error?  S_locationID is a text field.  Does that matter?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial