Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DCount and Calendar Control

Status
Not open for further replies.

dtigani

IS-IT--Management
Jan 22, 2004
9
AU
I am trying to get the value of a calendar control into a variable and use this in the following DCount command but I keep getting a count of 0.

setdate1 = CalCtrl.Value
CaseCount = DCount("[Date]", "Case", "[Date] = # " & setdate1 & " #")

I know the DCount command works because if I change the first line to: setdate = #3/2/2004# I get the right answer. I figure I must have to convert the CalCtrl.value somehow. Can anyone help?
 
Sorry. Just realised what went wrong. DCount must look for a date in mm/dd/yyyy format whilst I'm looking for a date in dd/mm/yyyy format.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top