Filter string: between dates (1 Viewer)

Mattcornish

Registered User.
Local time
Today, 08:02
Joined
Jun 18, 2011
Messages
12
I am passing a string to a docmd.openform that has the filter string in it

Start = Format(Text205.Text, "dd/mm/yy", vbMonday)
EndD = Format(Text208.Value, "dd/mm/yy", vbMonday)
*
If stLinkCriteria = "" Then
*
*
stLinkCriteria = "[Input Date] BETWEEN " & Start & " AND " & EndD

Ihave stepped through it and the string looks fine to me with the data filled in

I tried filtering the query it's based on directly using the same dates and it works

All I get at the minute is a blank report or a report with all entries (depending on what I have changed in the code to try get it to work)

Help me before I go insane, please please please

Cheers
 
Format, seems to put the date in US date format on my example

09/02/2012 (9th February 2012)

becomes 02/09/2012 when put through Format("dd/mm/yy", vbmonday)
 
Not on mine, mine comes out as 14/02/2012 :s
 
Code:
stLinkCriteria = "[Input Date] BETWEEN [b]#[/b]" & Start & "[b]#[/b] AND [b]#[/b]" & EndD & "[b]#[/b]"
is the only other suggestion off the top of my head
 
Code:
Start = Format(Text205[COLOR=Red].Text[/COLOR], "dd/mm/yy", vbMonday)
EndD = Format(Text208.Value, "dd/mm/yy", vbMonday)
Why .Text?
 
Wen this code runs the text hasn't been passed to the value yet
 
Does the code run in the Change event of the control? Do you validate it to ensure that it's a proper Date value before passing it to stLinkCriteria?
 
It runs on the click event of an image. I thought passing it to the format function was validating it?
 

Users who are viewing this thread

Back
Top Bottom