A
Arturo
I previously posted this question.
I am using the SendObject method to email a report as a Snapshot. The name of
the report is rptBilling. It names the Snapshot the same thing. How do I
rename this? I would like to name it “Bill For (first and last name of person
in the report).†Is this possible? The respective field names are FirstName
and LastName.
I was presented the code below.
Private Sub Report_Activate()
Me.Caption = "Report for " & [FirstName] & " " & [LastName]
ExitProc:
Exit Sub
ProcError:
MsgBox "Error: " & err.Number & ". " & err.Description, _
vbCritical, "Error in Report_Activate event procedure..."
Resume ExitProc
End Sub
This works great if I go from design view to Print Preview. However, if I
just open the report by double clicking on it, or with the following code
from a procedure on a form:
DoCmd.OpenReport "rptBilling", acViewPreview
I get a Visual Basic error 2427 that says “You entered an expression that
has no value.â€
Any ideas on how to correct this?
I am using the SendObject method to email a report as a Snapshot. The name of
the report is rptBilling. It names the Snapshot the same thing. How do I
rename this? I would like to name it “Bill For (first and last name of person
in the report).†Is this possible? The respective field names are FirstName
and LastName.
I was presented the code below.
Private Sub Report_Activate()
Me.Caption = "Report for " & [FirstName] & " " & [LastName]
ExitProc:
Exit Sub
ProcError:
MsgBox "Error: " & err.Number & ". " & err.Description, _
vbCritical, "Error in Report_Activate event procedure..."
Resume ExitProc
End Sub
This works great if I go from design view to Print Preview. However, if I
just open the report by double clicking on it, or with the following code
from a procedure on a form:
DoCmd.OpenReport "rptBilling", acViewPreview
I get a Visual Basic error 2427 that says “You entered an expression that
has no value.â€
Any ideas on how to correct this?