Link to home
Start Free TrialLog in
Avatar of JCJG
JCJG

asked on

Access 2007:Query change based on other criteria

I have the below query set up and I would like to add a condition to perform a different query based on a field value in another table.  

Specifically, if [Table4].[Test] has one of its values, equal to "*", I would like to return [qry3].[Cust ID]; otherwise perform the following.

SELECT [Table1].[Cust ID] INTO [NewTable]
FROM [qry1] INNER JOIN [qry2] ON [qry1].[ Cust ID] = [qry2].[ Cust ID];


How do I modify the query to do this?  Thanks.
Avatar of puppydogbuddy
puppydogbuddy

I think you could simplify things by actually storing the query name as a field in your "lookup" table. Candace Tripp has a demo mdb called "flexible query" on her web site.  After you get on her web site, scroll down alphabetically until you get to the letter "F".

       http://www.utterangel.com/UtterAngel/utterangel.aspx?cat=acc
ASKER CERTIFIED SOLUTION
Avatar of als315
als315
Flag of Russian Federation 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
The macro design view has a conditions column you can turn on, then you can do an if this do that, if that do this....

Chris B