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.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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".
You can also add Table4 and qry3  in your query (may be joins should be changed to left join) and add following column:
CustID: iif([Table4].[Test] = "*",[qry3].[Cust ID],[qry2].[Cust ID])

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Chris BRetiredCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.