Printing Single Record

  • Thread starter Thread starter Jeremy Dove
  • Start date Start date
J

Jeremy Dove

I am having the following problem. I have a form that is
based upon a query. When I try to print it prints all
1300 records. How can i make it so that it only prints a
single record when requested. Any help would be
appreciated. Thanks
 
Create a report that lays the data out for printing. (If you want the same
look, you can open your form in design view, and from the File menu, choose
Save As | Report.) The use the primary key value of the form in the
WhereCondition of the OpenReport action.

This example assumes you have a primary key (AutoNumber) named "ID". Place a
command button on your form, and put something like this into its Click
event procedure:

Private Sub cmdPrintRecord_Click()
If Me.Dirty Then 'Save first.
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Select the record to print.
Else
DoCmd.OpenReport "MyReport", acViewPreview, , "ID = " & Me.ID
End If
End Sub
 
That helped me get the form layout that I wanted. However
do you know how to make it so that I don't have to go to
the preview screen. I am trying to just send it to the
printer.

Thanks in advance for your help.
-----Original Message-----
Create a report that lays the data out for printing. (If you want the same
look, you can open your form in design view, and from the File menu, choose
Save As | Report.) The use the primary key value of the form in the
WhereCondition of the OpenReport action.

This example assumes you have a primary key (AutoNumber) named "ID". Place a
command button on your form, and put something like this into its Click
event procedure:

Private Sub cmdPrintRecord_Click()
If Me.Dirty Then 'Save first.
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Select the record to print.
Else
DoCmd.OpenReport "MyReport",
acViewPreview, , "ID = " & Me.ID
 
Back
Top