Help!

DitoKipo

New member
Local time
Today, 08:30
Joined
Feb 2, 2012
Messages
2

Hello !
I Have a problem and need your professional advice.
I want to choose the concrete time interval from MS Access Form. For this I have done 2 TextBox: Text1 and Text2, where I need it to make choice between the interval of the entered dates Table or Query (SQL Instruction).

In case of Filter
Me.FilterOn = True
Me.Filter = " datevalue(table1.tarigi) between '" & Me.Text1 & "' and '" & Me.Text2 & "'"
The following record isn’t working properly. Between makes only from the days.
And when I am writing this in the SQL select WHERE or HAVING in this time doesn’t make any choice.

 
Code:
Me.Filter = " datevalue(table1.tarigi) between #" & Me.Text1 & "# and #" & Me.Text2 & "#"
Me.FilterOn = True
 
I know this, but VBA doesn't recognize "#" in this case and it shows the syntax error.
 
I know this, but VBA doesn't recognize "#" in this case and it shows the syntax error.
It's not about knowing, it's about following exactly what apr pillai wrote. What he wrote (syntax wise) is different from what you have. His is properly formed and yours isn't.

Copy and paste what he's written.

By the way does your tarigi field have a Time element to it? Is that why you're using DateValue?
 

Users who are viewing this thread

Back
Top Bottom