J
Jim/Chris
Forms are for entering, changing and viewing data. Not
for printing or emailing. Create a report replicating the
form. On the form add a command button that previews the
report. The code would look something like this
Private Sub Button_Click()
On Error GoTo Err_Button_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "ReportName"
stLinkCriteria = "[FormID]=" & Me![FormID]
DoCmd.OpenReport stDocName, acViewPreview, ,
stLinkCriteria
Exit_Button_Click:
Exit Sub
Err_Button_Click:
MsgBox Err.Description
Resume Exit_Button_Click
End Sub
I picked this up in this newsgroup. You could email the
report at that time either by a macro and the SendObject
command or in code use the DoCmd.SendObject. There are
other ways also.
Good Luck
Jim
for printing or emailing. Create a report replicating the
form. On the form add a command button that previews the
report. The code would look something like this
Private Sub Button_Click()
On Error GoTo Err_Button_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "ReportName"
stLinkCriteria = "[FormID]=" & Me![FormID]
DoCmd.OpenReport stDocName, acViewPreview, ,
stLinkCriteria
Exit_Button_Click:
Exit Sub
Err_Button_Click:
MsgBox Err.Description
Resume Exit_Button_Click
End Sub
I picked this up in this newsgroup. You could email the
report at that time either by a macro and the SendObject
command or in code use the DoCmd.SendObject. There are
other ways also.
Good Luck
Jim