=DCount("*","tbl","[columnX] = 'A'")
To add more conditions:
=DCount("*","tbl","[columnX] = 'A' and [columnY] = 'B'")
if using variables:
=DCount("*","tbl","[columnX] = '" & VarA & "' and [columnY]...