Dcount on Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I have a quick quesion I hope someone might have an answer to.

I am trying to a dcount on a form. I am trying to use criteria that uses two
different fields. I have never done it with two different criteria and can
not get it to work. Here is the code: =DCount("[event_id]","All Incoming
Students","[batch_status] = 'EXCH'" And "Attended = No")

Am I even close? Thanks in advance for your help!!
 
Try this

=DCount("[event_id]","All Incoming Students","[batch_status] = 'EXCH' AND
Attended = No")

If Attended is string type then
=DCount("[event_id]","All Incoming Students","[batch_status] = 'EXCH' AND
Attended = 'No'")
 
Bill said:
I have a quick quesion I hope someone might have an answer to.

I am trying to a dcount on a form. I am trying to use criteria that uses two
different fields. I have never done it with two different criteria and can
not get it to work. Here is the code: =DCount("[event_id]","All Incoming
Students","[batch_status] = 'EXCH'" And "Attended = No")

Am I even close? Thanks in advance for your help!!


Very close, just too many quotes. The And is part of the
criteria, not an operator to create the criteria string.

. . .,"[batch_status] = 'EXCH' And Attended = No")
 
Back
Top