Print single record in form view

Zorkmid

Registered User.
Local time
Today, 07:42
Joined
Mar 3, 2009
Messages
188
Hi there,

I have a search form that returns all the records that match all criteria in a subform, which is set up so that the nav buttons take you from one record to the next. Sometimes more than one record matches the criteria, and I would like a command button to print just a single record from the subform.

When I tried to use the button that the wizard makes, it prints all of returned records instead of just the one that is selected.

Any ideas ? Please let me know if I can clarify my request.

-Z
 
Hi there,

I have a search form that returns all the records that match all criteria in a subform, which is set up so that the nav buttons take you from one record to the next. Sometimes more than one record matches the criteria, and I would like a command button to print just a single record from the subform.

When I tried to use the button that the wizard makes, it prints all of returned records instead of just the one that is selected.

Any ideas ? Please let me know if I can clarify my request.

-Z

I would just modify the code made by the wizard so that the DoCmd.Open report has a WHERE parameter to limit the report to the desired record.

Example:

Code:
    DoCmd.OpenReport stDocName, acPreview, , "ID=" & Me.Id
 
Ok here is the code the wizard does.

Code:
Private Sub Command60_Click()
On Error GoTo Err_Command60_Click
   
    DoCmd.PrintOut
Exit_Command60_Click:
    Exit Sub
Err_Command60_Click:
    MsgBox err.Description
    Resume Exit_Command60_Click
    
End Sub

I'm not sure how to apply your suggestion

-Z
 

Users who are viewing this thread

Back
Top Bottom