Conditional Macro

  • Thread starter Thread starter Maynard
  • Start date Start date
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
 
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
 
Back
Top