problem displaying report by date

drshahriyar

Registered User.
Local time
Today, 14:47
Joined
Feb 11, 2007
Messages
21
hi, i am new user of access. i have created a form that takes patients information who are going to be operated. the report group the patients according to date. when i use the command button on my form to display report, i get the reports of al the patients starting from page 1. what i want is that the command button on my form looks for the date field in the form and open the report of all the patients in that date.
thanks in advance
 
drshahriyar said:
hi, i am new user of access. i have created a form that takes patients information who are going to be operated. the report group the patients according to date. when i use the command button on my form to display report, i get the reports of al the patients starting from page 1. what i want is that the command button on my form looks for the date field in the form and open the report of all the patients in that date.
thanks in advance

Create a query to use as the record source for your report that specifies the operation date from your Form - something like ...

SELECT Yourtable.*

FROM YourTable

WHERE YourDateField = Forms!YourForm!YourControlName

ORDER BY YourDateField, YourPatientNameField;
 
thanks for the quick reply. i am a novice in access and therefore unable to understand what you said. could you give me more details.
 
drshahriyar said:
thanks for the quick reply. i am a novice in access and therefore unable to understand what you said. could you give me more details.

Your report uses a Record Source (which you can find in its properties when you are in Report View for the report) You need to create a query or change the one already there to look like this and use that as the record source. That way, the report will know exactly what to well ... report.

To find the record source. right-click on the open report and change it to REPORT VIEW, then right-click again and select PROPERTIES. Once in properties click on DATA. the first choice there should be RECORD SOURCE. Something should be in that box. Click in the box and then on the three dots. That should bring up the query in SQL.

SELECT Yourtable.*
(is the name of the table that the form uses for its fields. In the above statement you are asking it to select all the fields in the table)

FROM YourTable
(This is telling it what table to look in for these fields)

WHERE YourDateField = Forms!YourForm!YourControlName
(YourDatefield is the field in the table that refers to the operation date)

(YourForm is the name that you gave the form that you referred to in your original post)

(YourControlName is the name of the textbox in your form that holds the operation date)

ORDER BY YourDateField, YourPatientNameField;
YourPatientNameField is the name of the field in your table that refers to the patient)

(This tells the query to put the results in date order and then in alphabetical order by name within that date)

I can't get much more detailed than this. I hope it helps to point you in the right direction.
 
thanks a million. you don't know how grateful i am to you.
God bless.
 

Users who are viewing this thread

Back
Top Bottom