DCount Problem

D

DS

I have a DCount that isn't working, I think its the criteria part. Its
says missing Operator.

Me.Text18 = DCount("EmployeeID", "Employees", EmployeeID & " = Me.TextD")

I tried This Also..

Me.Text18 = DCount("EmployeeID", "Employees", "EmployeeID = Me.TextD")

This says Operation Cancelled

Any help, as always appreciated.
Thanks
DS
 
J

Jeff O via AccessMonster.com

DS, I believe whats missing here are proper single quotes. try:
Me.Text18 = DCount("EmployeeID", "Employees", [EmployeeID] = "'" & Me.TextD&
"' ")
(it hard to see but there are single quotes before and after the Me.TextD
value)

/Jeff
 
J

Jeff O via AccessMonster.com

DS, I spoke too soon. Here is the proper sequence. I tested it.
"[status] = '" & stat & "'")

Me.Text18 = DCount("EmployeeID", "Employees", "[EmployeeID] = ' " & Me.TextD
& "'"

/Jeff


Jeff said:
DS, I believe whats missing here are proper single quotes. try:
Me.Text18 = DCount("EmployeeID", "Employees", [EmployeeID] = "'" & Me.TextD&
"' ")
(it hard to see but there are single quotes before and after the Me.TextD
value)

/Jeff
I have a DCount that isn't working, I think its the criteria part. Its
says missing Operator.
[quoted text clipped - 10 lines]
Thanks
DS
 
D

DS

Jeff said:
DS, I spoke too soon. Here is the proper sequence. I tested it.
"[status] = '" & stat & "'")

Me.Text18 = DCount("EmployeeID", "Employees", "[EmployeeID] = ' " & Me.TextD
& "'"

/Jeff


Jeff said:
DS, I believe whats missing here are proper single quotes. try:
Me.Text18 = DCount("EmployeeID", "Employees", [EmployeeID] = "'" & Me.TextD&
"' ")
(it hard to see but there are single quotes before and after the Me.TextD
value)

/Jeff

I have a DCount that isn't working, I think its the criteria part. Its
says missing Operator.

[quoted text clipped - 10 lines]
Thanks
DS
Thanks, Jeff.
That did it
DS
 

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

Similar Threads

Access Dcount (multiple criteria) 3
DCount Syntax 2
SQL If Problem 7
DCount to check duplicates 8
If Statement is Wacky 2
DCount 2 Criteria 2
DCount Problem 2
VBA Syntax issue (I hope) 7

Top