Dcount on Form

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!!
 
G

Guest

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'")
 
M

Marshall Barton

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")
 

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