Form which filters records in a table > display in report

M

Martijn

Hello,

I'm trying to design a form in which to dates can be typed.
These dates are: startdate & endingdate (shortdate).
In a table (tblRecords) is some information stored like:
date, delay, ATAchapter, Sta ....
What I need is the following: A command so that the
startdate and endingdate, which are given in the form,
filters the records in the table and displaying them in a
report.
I don't know much about programming or access at all (it's
a trainee assignment) so if it contains code please tell
me how

(I'm sorry for my English but I hope you know what I mean.)

Best Regards,

Martijn
 
P

Pavel Romashkin

Create two unbound text boxes on your form, name them txtStartDate, txtEndDate.
Create a query like this:

SELECT * FROM MyTable WHERE theDate BETWEEN Forms.MyForm.txtStartDate
AND txtEndDate

Save this query and name it qryFilteredMyTable
Create a report and base it on this query. Note that you must open the
report only when the form is opened and dates are entered. To make sure
this condition is satisfied, set default txtStartDate and txtEndDate to
1/1/1900 and 1/1/2099, and create a command button that will open the
report from the form.

Good luck,
Pavel
 

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