Dumb question...need to build a simply query to report.

  • Thread starter Thread starter TYLER_DURDEN_SOAP
  • Start date Start date
T

TYLER_DURDEN_SOAP

I'm still new to building databases

I want to build a query that I can type a name of a doctor into it an
it will bring up all the records under that Doc. The name of th
field is Patient's PCM. I then want those records to be placed on
report for only the selected doc. Can you help me out
 
I'm still new to building databases.

I want to build a query that I can type a name of a doctor into it and
it will bring up all the records under that Doc. The name of the
field is Patient's PCM. I then want those records to be placed on a
report for only the selected doc. Can you help me out.

Assuming the actual value of the [PCM] field is a number datatype (the
doctors unique prime key number):
Create an unbound form.
Add a combo box.
Set the Row Source of the combo box to include the
DoctorID field and the DoctorName.
Name the Combo Box 'FindDoctor'.
Set it's Bound column to 1.
Set it's Column Count property to 2.
Set the Column Width property to 0";1"

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'.

In the Query's (the Report's Record Source) [PCM] field criteria line
write:
forms!ParamForm!FindDoctor

Next, code the report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the selection of the Doctor wanted.
Click the command button and then report will run.
When the report closes, it will close the form.
 
Under your field in your query put something like....

Like "*" & [EnterPartialDoctorName] & "*"

Then save the query and build a report based on it. When you run the report
or the query it will prompt the user to enter a portion of the doctor's name
and will only select matching records.
 

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

Back
Top