Malkadore
asked on
DCount - Datatype missmatch in Criteria
What am I doing wrong?
Me.Text0 = DCount("*", "Table1", "[Field1] = 'Date()'")
- Malk
Me.Text0 = DCount("*", "Table1", "[Field1] = 'Date()'")
- Malk
Me.Text0 = DCount("*", "Table1", "[Field1] = Date()")
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Or :
Me.Text0 = DCount("*", "Table1", "[Field1] = #" & Date() & "#")
Me.Text0 = DCount("*", "Table1", "[Field1] = #" & Date() & "#")
ASKER
Thanks!
- Malk
- Malk
Did you try my solution (the first post) it will also work...
Me.Text0 = DCount("*", "Table1", "[Field1] = Date()")
Me.Text0 = DCount("*", "Table1", "[Field1] = Date()")
ASKER
Sorry Jm, I thought I had selected yours, but I guess not.
I'm trying to figure out why #'s were necessary when obviously they aren't looking at your 1st solution.
I'm trying to figure out why #'s were necessary when obviously they aren't looking at your 1st solution.
They would be necessary if you were to pass a variable containing a date like :
Me.Text0 = DCount("*", "Table1", "[Field1] = #" & MyDateVariable & "#")
But there not if your using the date function the way I used it in my first post...
Me.Text0 = DCount("*", "Table1", "[Field1] = #" & MyDateVariable & "#")
But there not if your using the date function the way I used it in my first post...
ASKER
Yeah, I'm using it.
Maybe u can help me with this? and I'll make up for this q.
https://www.experts-exchange.com/questions/21755226/Dcount-If-Statement.html
Maybe u can help me with this? and I'll make up for this q.
https://www.experts-exchange.com/questions/21755226/Dcount-If-Statement.html