Printing address labels

H

hospitalhelp

I work in a hospital and have all the radiology patients set up in a
database. For each x-ray we must have a small card containing patients
information. I set up address labels with the info I need but now I can not
get the label to print out the patient I need. Any ideas on how to make this
work?
 
R

Rick B

On your form, you would create a button with code similar to the following:


Button to print specific record:


Private Sub Print_Button_Click()

If (IsNull([PatientID])) Then

' Verify the key field (PatientID) has a selection

Exit Sub

End If

DoCmd.OpenReport "SomeReportName", acViewNormal, "","[PatientID] =
Forms![frmSomeFormName]![PatientID]"

End Sub
 
T

Tom Wickerath

You really haven't given enough information for anyone to provide an accurate answer. If you
open your label report in design view, click on View > Properties, and select the Data tab (with
Report shown in the blue title bar), what do you have specified as the recordsource for this
report? Is it a table or a query? Click on the ellipse button (the button with the three dots).
This should open the query builder. Run the query. Do you see the patient you need in the
results? If this is a query already, does it include any criteria that might be filtering out
your desired patient?

If you only want to print out labels for a single patient at a time, you can use a command button
on a form that displays the patient's information. You can pass the primary key of the patient
(you have established primary keys in your tables, right?) as a part of the WhereCondition of the
DoCmd.OpenReport statement. An alternate method is to base the recordsource of the label report
on a query that includes a criteria that is picked up from the open form. Without knowing more
about how you set this up, it's difficult to provide a better answer.

Tom
______________________________________


I work in a hospital and have all the radiology patients set up in a
database. For each x-ray we must have a small card containing patients
information. I set up address labels with the info I need but now I can not
get the label to print out the patient I need. Any ideas on how to make this
work?
 
Top