Hi,
any help for this newbie question is appreciated:
I have a button to create a preview report of the current record as follows:
Private Sub reportPV_Click()
Dim strDocName As String
Dim strWhere As String
strDocName = "Warehouse_Incident_table"
strWhere = "[Incident Number]=" & Me![Incident Number]
DoCmd.OpenReport strDocName, acViewPreview, ,strWhere
End Sub
If I copy the syntax of above to send the current report via attachment e.g.:
Private Sub SendRpt_Click()
Dim strDocName As String
Dim strWhere As String
strDocName = "Warehouse_Incident_table"
strWhere = "[Incident Number]=" & Me![Incident Number]
DoCmd.SendObject acReport, strWhere
End Sub
I get an error 'run time error 2103, the report name [incident number]=1 you entered in the property sheet or macro is misspelled or refers to a report that doesn't exist.
I know there something basic and fundementally wrong with the code but am stumped(sorry if this is a little basic, we all started somewhere! lol).
rcp
any help for this newbie question is appreciated:
I have a button to create a preview report of the current record as follows:
Private Sub reportPV_Click()
Dim strDocName As String
Dim strWhere As String
strDocName = "Warehouse_Incident_table"
strWhere = "[Incident Number]=" & Me![Incident Number]
DoCmd.OpenReport strDocName, acViewPreview, ,strWhere
End Sub
If I copy the syntax of above to send the current report via attachment e.g.:
Private Sub SendRpt_Click()
Dim strDocName As String
Dim strWhere As String
strDocName = "Warehouse_Incident_table"
strWhere = "[Incident Number]=" & Me![Incident Number]
DoCmd.SendObject acReport, strWhere
End Sub
I get an error 'run time error 2103, the report name [incident number]=1 you entered in the property sheet or macro is misspelled or refers to a report that doesn't exist.
I know there something basic and fundementally wrong with the code but am stumped(sorry if this is a little basic, we all started somewhere! lol).
rcp