Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add more conditions to DCount textbox 2

Status
Not open for further replies.

Sandman007

Programmer
Jun 20, 2001
47
US
I'm using the following:
=DCount("*","tbl","[columnX] = 'A'")
I'd like to add a condition that says columnX = A and columnY=B.
Can I do that. Anyone have the syntax?
 
=DCount("*","tbl","[columnX] = 'A'")

To add more conditions:

=DCount("*","tbl","[columnX] = 'A' and [columnY] = 'B'")

if using variables:

=DCount("*","tbl","[columnX] = '" & VarA & "' and [columnY] = '" & varB & "'")

In the above example remove the single apostrophes if the variable contains a number and change them to pound (#) signs if they contain date string.

You can add more if needed following the same pattern.

Hope this helps.

Larry DeMaio
SDC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top