Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a query from a form?

Status
Not open for further replies.

Delboy14

Programmer
Jun 21, 2001
213
GB
Access 2002

I want to run a query from a form when a button is pressed.
A button in the form will be pressed called, "produce list of Practices". This will produce a list of Doctors Practices who are due a report; Due today, a list of those who are due a report but are within a 2 week grace period and those who are due a report and are out with the 2 week grace period. (reports are due every three months, the grace period relates to the fact that surgeries should hand in their data every three months to be analysed).

The table is called Practice Details and the field is Date Due, I would like to compare the field Date Due with the current date and display a list of those records (practices):
where Date Due < or equal to CurrentDate. And the field Data Submitted is true.
where Date Due < two weeks before CurrentDate
And the field Data Submitted is False
where Date Due > two weeks before CurrentDate
And the field Data Submitted is False
I would like to display the results in a page of a form
DO I need to create a query which is run when the button is pressed, and then display the results of this query on a page in a form? If so how do I run the query from the button.

thanks in advance for any help
 


Hi Delboy14

Do you know that Reports and Forms can have queries as recordsouces?

I think in your case you can have a button opening up a form or report. There is a wizard to do that when you place a button on a form.

Sounds easy.


Stew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top