I want to email a report as a PDF-file using a button on a form.
This works fine. The report is created, converted to a PDF , attached to the mail, etc.
But....I want to change the name of the report that is emailed.
For this I use following code for the on open event of the report:
Private Sub Report_Open(Cancel As Integer)
Me.Caption = "Blokkeringsnummer " & "Versie "
End Sub
This works fine, but I want to include the values of the fields [Blokkeringsnummer] and [Versie] in the name of the report. These fields are also on the report, and the report reports only 1 record.
I tried this code:
Private Sub Report_Open(Cancel As Integer)
Me.Caption = "Blokkeringsnummer " & Me!Blokkeringsnummer & "Versie " & Me!Versie
End Sub
and this code:
Private Sub Report_Open(Cancel As Integer)
Me.Caption = "Blokkeringsnummer " & Me![Blokkeringsnummer] & "Versie " & Me![Versie]
End Sub
In both cases I get an error 2427
What am I doing wrong?
This works fine. The report is created, converted to a PDF , attached to the mail, etc.
But....I want to change the name of the report that is emailed.
For this I use following code for the on open event of the report:
Private Sub Report_Open(Cancel As Integer)
Me.Caption = "Blokkeringsnummer " & "Versie "
End Sub
This works fine, but I want to include the values of the fields [Blokkeringsnummer] and [Versie] in the name of the report. These fields are also on the report, and the report reports only 1 record.
I tried this code:
Private Sub Report_Open(Cancel As Integer)
Me.Caption = "Blokkeringsnummer " & Me!Blokkeringsnummer & "Versie " & Me!Versie
End Sub
and this code:
Private Sub Report_Open(Cancel As Integer)
Me.Caption = "Blokkeringsnummer " & Me![Blokkeringsnummer] & "Versie " & Me![Versie]
End Sub
In both cases I get an error 2427
What am I doing wrong?