report by unique identifier

G

Guest

Hi,

I have a command button on a form. The form brings up patient information
by a unique identifier called PatientID. The button calls open to preview
before printing a form a sheet of 30 labels. The problem, is that instead of
bringing up just a sheet for that one patient, it brings up a sheet of 30
labels for every patient.

any help would be appreciated. The code is below.

Private Sub cmdHCPatientLabel_Click()

DoCmd.OpenForm "HC_labels", acNormal, ,
"[forms]![frmPatients]![PatientID]=" & [PatientID]


End Sub
 
A

apna

I think try this

DoCmd.OpenForm "HC_labels", acSelection, ,
"[forms]![frmPatients]![PatientID]=" & [PatientID]
 
G

Guest

that opened the form in design view.

apna said:
I think try this

DoCmd.OpenForm "HC_labels", acSelection, ,
"[forms]![frmPatients]![PatientID]=" & [PatientID]


fascal said:
Hi,

I have a command button on a form. The form brings up patient information
by a unique identifier called PatientID. The button calls open to preview
before printing a form a sheet of 30 labels. The problem, is that instead
of
bringing up just a sheet for that one patient, it brings up a sheet of 30
labels for every patient.

any help would be appreciated. The code is below.

Private Sub cmdHCPatientLabel_Click()

DoCmd.OpenForm "HC_labels", acNormal, ,
"[forms]![frmPatients]![PatientID]=" & [PatientID]


End Sub
 

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

Top