Conditional Macro

M

Maynard

I am using a combo box to look up records. I want to set a
condition so that if the record name is not in the
underlying query, it will open a second form. I set the
CONDITION to open the form as:
forms![formName]![ComboBox] = [queryName]![queryValue]

and the macro ACTION as:
OpenForm with a "Where Condition" that opens the form that
corresponds with the underlying query.

This brings up an error. I think the problem is a conflict
between the "Where condition" and the "Condition"
essentially doing the same thing.

Maynard
 
S

Steve Schapel

Maynard,

[queryName]![queryValue] is not correct syntax. This means nothing to
Access, which when you think about it is fair enough, as there is no
way of knowing which record in the query you are referring to.

Here's one way to use the macro Condition, and if I understand you
correctly, will do the job...
DCount("*","queryName","[queryValue]=" & [ComboBox])>0

- Steve Schapel, Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top