How to search a table/query for a date range

B

bzeyger

I have an Access DB that contain multiple form, queries, tables, and reports.
I have one query that containes a various about of information (Name, Title,
Hire Date).
I have a form created with two text boxes and a command button. The user is
suppsed to enter a start date and an end date then press the command button.
The employees that fit into the date range get displayed. You do I get this
to work?

Right now it only didplays all the information. I am tring to get the date
ranges to function.
 
T

Tom van Stiphout

On Tue, 22 Jan 2008 17:59:36 -0800, bzeyger

There are several ways. One is to set the form's Filter property. In
the command button's Click event write two lines of code:
Me.Filter = "HireDate BETWEEN #" & Me.txtStartDate & "# AND #" &
Me.txtEndDate & "#"
Me.FilterOn = True
(of course you substitute your own control and field names)

-Tom.
 

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