Recordsource Woes... (1 Viewer)

GMC

Registered User.
Local time
Today, 01:05
Joined
Nov 1, 1999
Messages
10
I have a continuous form that initially opens showing all records from a table called DESPATCH_HEADER. In the form header are four combo boxes (TargetDespatchDate, SiteCode, Squad, LoadPoint) that are used to narrow down the records displayed by this continuous form.

BUT, I'm having problems with the TargetDespatchDate combo box; it seems that the SQL statement behind the AfterUpdate event is attempting to convert the date to American format. For all dates that are above the 12th of the month, the statement resolves fine, but in situations where the date COULD be converted it does. No matter what formatting I apply to the underlying field, the SQL statement, etc, it doesn't help.

I've included the statement below for reference.

Can anybody help?

TIA
Grant

SQL Statement:
-----------------------------
Form_frmViewSiteDespatches.RecordSource = "SELECT * FROM DESPATCH_HEADER WHERE ((DESPATCH_HEADER.TargetDespatchDate)= #" & Format(Forms![frmViewSiteDespatches]![cmbTargetDespatchDate], "dd/mm/yyyy") & "#);"
-----------------------------
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 20:05
Joined
Feb 19, 2002
Messages
43,328
SQL requires that date fields be in US date format. You must change the format statement to:
Format(Forms![frmViewSiteDespatches]![cmbTargetDespatchDate], "mm/dd/yyyy")
 

Users who are viewing this thread

Top Bottom