I am receiving a Datatype mismatch error when the following espression is used. TaskDate is formatted as a Short Date.
Code:Iter = DCount("[TaskDate]", "Job Number and Date Range")
I am receiving a Datatype mismatch error when the following espression is used. TaskDate is formatted as a Short Date.
Code:Iter = DCount("[TaskDate]", "Job Number and Date Range")
in vba?
first, take the braces off. second, if ITER is not a long or integer, that's probably the issue.
Adam,
I see no braces used by the OP. {} All I see are brachets. [] which should work except they were not used in the 2nd argument which would be necessary with embedded spaces in a name. Lastly, if in fact the [TaskDate] is truly a dateTime field then ITER should be one as well. Sorry for jumping in here.
Well, then I guess I need to brush up on my enclosure characters!Adam,
I see no braces used by the OP. {} All I see are brachets. [] which should work except they were not used in the 2nd argument which would be necessary with embedded spaces in a name. Lastly, if in fact the [TaskDate] is truly a dateTime field then ITER should be one as well. Sorry for jumping in here.Sorry about that...YES, drop the brackets, NOT braces. IMO, it's a good practice. If I remember, domain aggregates in VBA though, in the field argument section, worth with AND without them, so that part of my post is really irrelevant.
DCOUNT does not return a date, Allan. Are you absolutely sure about this?
Oops!D'uh...DCount. That would make it an integer of some sort wouldn't it?
![]()
I worked around the Iter issue, I created a TempVar to hold it, my problem still seems to be the date. I am using TempVar to store date, but the query returns nothing if I use the following.
Code:Between [TempVars]![queryStartDate] And [TempVars]![queryStopDate]