rosco17
05-10-2003, 07:04 AM
I'm new with Access. I need to find out how to print one record on a specific report without it printing every other record that matches the selected ones subject. My Form is a daily activity log and I have incidents that occur which are logged. I need to print only each incident on a single incident report. When I try to print it prints every incident on the report. I only need the one here and if one occurs later that one. Not all of the them at once on 1 page. Someone please help. I'm reaaly new at this.:confused:
jfgambit
05-10-2003, 09:01 AM
Assuming your form each incident has a Unique ID pass this to the Report by adding the following to the On Click event of a Command Button:
Dim stLinkCriteria As String
Dim stDocName As String
stLinkCriteria = "[IDNumber] = " & Me.IDNumber
stDocName = "NameofReport"
DoCmd.OpenReport stDocName, , , stLinkCriteria
IDNumber is the name of the Unique ID field in your Form
HTH
Pat Hartman
05-10-2003, 07:27 PM
You need to save the record prior to printing to make sure that any changes are picked up as well as new records. Just add the following statement on the line above the OpenReport statement.
DoCmd.RunCommand acCmdSaveRecord