use count query result in an IF statement

M

michael goodall

can anyone send me the code to use the result of a count query in an
IF statement. i basically want it to be like IF count result = 1 THEN
open form swimmers ELSE open form error. many thanks michael
 
O

Ofer Cohen

Try

If Nz(DlookUp("FieldName","QueryName"),0)=1 Then
Docmd.OpenForm "swimmers"
Else
Docmd.OpenForm "ErrorForm"
End If
 

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