syntax for default value

T

TESA0_4

Hi,
I have a simple syntax question. Respectively, the following lines of code
will default the first PerID where Active=-1 and the first PerID where
OHSRep=-1.
=DFirst("PerID","tblPers","Active=-1")
=DFirst("PerID","tblPers","OHSRep=-1")
However, what I want is the first PerID where Active=-1 And OHSRep=-1. What
is the syntax for the WHERE portion of the expression? I've tried various
forms such as the following but get #Error.
=DFirst("PerID","tblPers","Active=-1" And "OHSRep=-1")
Thanks in anticipation of some advice.
Tesa
 
A

Allen Browne

Try criteria like this:
=DFirst("PerID","tblPers","(Active=-1) And (OHSRep=-1)")

I'm not sure if you need DMin() rather than DFirst().
 

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

Similar Threads


Top