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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft Access 2003 database

Status
Not open for further replies.

elgirod

Technical User
Oct 15, 2006
3
US
I have created a database for tracking xray exams with (2) tables one for Patient info and one for Exams for the patient. I have also created a basic report for printing log book pages with the patient ID, date of exam, patient name, exam, and date of report. What I would like to do is print the report by the month of the exams. Example I would like to print a report to include just a particular month say 10/01/2006 through 10/31/2006. Is there a way to do this in the report format. I know I can set up a query but I cant seem to print that info in the report.
 
There is a forum for Access teports:
Microsoft: Access Reports Forum
forum703

What is the problem? Selecting the data or including the selection in a header?
 
no I cant get the data that I want in the report I want to be able to select a certain date rage for the report on a monthly basis
 
How do you want this to happen?
- You can use parameters in a query;
- You can use a form to enter the dates and have a query pick up the range;
- You can open an existing report with a date range as a Where statement;
- you can do all of the above with a month number, rather than a date range.

There may be more, but I can't think of them at the moment.
 
I would like to try using your 2 examples you stated

You can use a form to enter the dates and have a query pick up the range;
- You can open an existing report with a date range as a Where statement;
that would help alot thank you very much

 
These two are alternatives, if you have one, you do not need the other.

[Blue]Background[/Blue]
Let us say that you have a an unbound form called frmForm, which has two text boxes called txtStart and txtEnd, both formatted as dates.

[blue]Option 1[/blue]
Let us say that in additon to frmForm, you have a report called rptRepotOn and on frmForm you have a command button called cmdPreview. The code behind cmdPreview would be:

Code:
Private Sub cmdPreview_Click()
    stDocName = "rptReport"
    DoCmd.OpenReport stDocName, acPreview, , "[Date of Exam] Between " & Me.txtStart & " And " & Me.txtEnd
End Sub

[Date of Exam] is the name of the field that holds exam dates.

[blue]Option 2[/blue]
Create a query from the table you wish to use for a report and add:

[tt]Between Forms!frmForm!txtStart And Forms!frmForm!txtEnd[/tt]

To the criteria line of the form, under the exam dates field.

Fill in the form and open the query. If all is well, use this query to build a report. The report will only work properly when the form is open.



You will find a great deal of information, if you visit the Access Reports forum that I mentioned in my first post.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top