DCount using Multiple Criteria (1 Viewer)

Thumper75

Registered User.
Local time
Today, 08:24
Joined
Feb 6, 2017
Messages
37
Ok I'm stuck. I used a bit of a work around to get the results that I am looking for.

I have individually tested these lines of code below. The first two work interdependently, but my attempt at getting them both continues to fail. I either get a "Missing Operator" error or "Expected List Separator error.

Code:
cnt = DCount("[Logpg]", "tbl_Log_Pages", "[tail] = '" & t & "'")  'This code works as a stand alone
'cnt = DCount("[Logpg]", "tbl_Log_Pages", "[trick] = '" & param & "'")   'This code works as a stand alone
'cnt = DCount("[Logpg]", "tbl_Log_Pages", "[tail] = '" & t & "'" And "[trick] = '" & param & "'")  'This is not working

I have been testing them individually by commenting the inoperative one out. For the actual desired DCount result, I must capture both inputs, but I cannot seem to figure out where I have gone wrong. :banghead:

I am certain it has something to do with the way I am attempting to input it, too many or too few characters. Any help here is appreciated.
 

June7

AWF VIP
Local time
Today, 05:24
Joined
Mar 9, 2014
Messages
5,425
Remove extraneous quote marks around AND.

cnt = DCount("[Logpg]", "tbl_Log_Pages", "[tail] = '" & t & "' And [trick] = '" & param & "'")
 

Thumper75

Registered User.
Local time
Today, 08:24
Joined
Feb 6, 2017
Messages
37
June,
your Solution doesn't seem to work.

This is how I have it typed in

Code:
'Change the log page status to closed
Me.txt_status.Value = "Closed"

As soon as I move away from the line I get the message
"Compile Error: Expected list seperator or )"

Any Ideas?
 

Thumper75

Registered User.
Local time
Today, 08:24
Joined
Feb 6, 2017
Messages
37
Never mind, I found my mistake. Thanks for the help that was the solution! :)
 

Users who are viewing this thread

Top Bottom