Re: Use of DateSelect in SQL filter
From: TC (no_at_email.here)
Date: 05/03/04
- Next message: Dirk Goldgar: "Re: Recordset Error"
- Previous message: TC: "Re: Form Behavior Problem"
- In reply to: Ian Bayly: "Use of DateSelect in SQL filter"
- Next in thread: Van T. Dinh: "Re: Use of DateSelect in SQL filter"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 3 May 2004 13:55:02 +0930
Not to answer your question, but:- this kind of code is asking for trouble:
... BETWEEN #" & Format(Me.txCalcFrom, "Medium Date") & "# AND #" ...
Dates supplied in the #...# format must be in month/day/year order,
>regardless of your regional settings<. So you should really change "Medium
Date" to "mm/dd/yyyy" in the code above. Some people say to use
"mm\/dd\/yyyy", which is even safer.
HTH,
TC
"Ian Bayly" <ianbayly@paradise.net.nz> wrote in message
news:O$FNl5LMEHA.128@TK2MSFTNGP09.phx.gbl...
> I keep a hierachy of backups of a project.
> My most recent copy fails at line 300 in the code below, with the message
> "Enter Parameter" with parameter "value "DateSelect":
> No changes have been made to this form and prior copies still run this
code
> OK.
>
> Any ideas what I could have done. Unfortunately I am 6 hours into changes
> which I don't want to redo!
>
> All help appreciated
>
> Ian B
>
> 210: Select Case obSelection
> Case 1
> 230: sFilter = "EntrySourceCode = '" & Me.comboType & "'"
> 240: Case 2
> 250: sFilter = "RefNum = '" & Me.txID & "'"
> 260: Case 3
> 270: sFilter = "EntrySourceCode = '" & Me.comboType & "' AND
> RefNum = '" & Me.txID & "'"
> 280: End Select
> 290: sFilter = sFilter & " AND (DateSelect BETWEEN #" &
> Format(Me.txCalcFrom, "Medium Date") & "# AND #" & Format(Me.txCalcTo,
> "Medium Date") & "#)"
> 300: DoCmd.OpenForm "frmLogView", acFormDS, , sFilter, acFormReadOnly
>
>
- Next message: Dirk Goldgar: "Re: Recordset Error"
- Previous message: TC: "Re: Form Behavior Problem"
- In reply to: Ian Bayly: "Use of DateSelect in SQL filter"
- Next in thread: Van T. Dinh: "Re: Use of DateSelect in SQL filter"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|