R
rml
I have a form with the following code in a command button. I would like to
print that current record onto a report. It prints out the record on the
report but it also prints the all the records form the form. Does anyone
know what I'm doing wrong here?
Thanks.
Private Sub Command217_Click()
On Error GoTo Err_Command217_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "aaa"
stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenReport stDocName, , , stLinkCriteria
DoCmd.DoMenuItem acFormBar, acFile, 6
Exit_Command217_Click:
Exit Sub
Err_Command217_Click:
MsgBox Err.Description
Resume Exit_Command217_Click
End Sub
print that current record onto a report. It prints out the record on the
report but it also prints the all the records form the form. Does anyone
know what I'm doing wrong here?
Thanks.
Private Sub Command217_Click()
On Error GoTo Err_Command217_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "aaa"
stLinkCriteria = "[ID]=" & Me![ID]
DoCmd.OpenReport stDocName, , , stLinkCriteria
DoCmd.DoMenuItem acFormBar, acFile, 6
Exit_Command217_Click:
Exit Sub
Err_Command217_Click:
MsgBox Err.Description
Resume Exit_Command217_Click
End Sub