Sending data to a report

knoppix

Registered User.
Local time
Today, 07:20
Joined
Aug 26, 2004
Messages
10
Just wondering how to send the data that i have just entered to a report and print it. I have a print button that prints the report on the form itself. The problem is that when i enter the info for form # 800, i only want to print that info for form 800 not the info for forms 1 to 800.
 
Paste this code below in a From for onclick event command button.

On Error GoTo Err_your command button name_Click
Dim strDocName As String
Dim strLinkCriteria As String

strDocName = "Report Name"
strLinkCriteria = "[Field Name] = Forms![Form Name]![Field Name]"

DoCmd.OpenReport strDocName, acNormal, , strLinkCriteria

Exit_your command button name_Click:
Exit Sub

Err_your command button name_Click:
MsgBox Err.Description
Resume Exit_your command button name_Click

hth,

Michael
 

Users who are viewing this thread

Back
Top Bottom