How to use the function of filtering to filter a range (from: ?? to ??)

S

Sam Hung

Hi All,

This is Sam. I'm now having some troubles about using the
function of filtering.
I'm expecting to write up a function to filter one of
columns(month - from: ?? to ??)
For example: I have a database table like this:
Year month day
2000 01 20
2003 02 26
2002 08 09
2002 06 14
2000 02 10
2003 04 08
I wanna have two textboxes to input the range of month I
want to select. As I type in two text boxes, say the range
from '02' to '06', four data should be selected and
displayed in the tabular form.

What's the command should be looked like?
If to select one of forms, it is fine.

Filtering method for one selection only:
If KeyCode = 13 Then
Me.Filter = "Table.Column='"& Trim(Textboxname.Text)& "'"
Me.FilterOn = True
End If

Please help,
Thanks,
Sam.
 
M

Michel Walsh

Hi,


You don't care about the year? then


" MONTH(DateTimeFieldName) BETWEEN " & ME.FromMonth & " AND "
ME.ToMonth


should do. Note that ALL CAPS words are keywords, the other have to be
changed to reflect your own names.



Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top