syntax for default value

  • Thread starter Thread starter TESA0_4
  • Start date Start date
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
 
Try criteria like this:
=DFirst("PerID","tblPers","(Active=-1) And (OHSRep=-1)")

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