J
Jack Isaacs
Hello All
I have a procedure Jmail that sends a specified file by email. It works fine
normally. But when I want to include in the filename a value from the
current form, I can't get it to work.
i.e. when the parameter is
"\\server\pdocprogrammes\client_reports\gp1 complete all.pdf"
it works, but when I need to add [forms]![frm x main]![month name] to the
file name I tried:
"""\\server\pdocprogrammes\client_reports\gp1 complete all"" & [forms]!frm x
main]![month name]&"".pdf"""
(i.e. double quotes round the two 'hard-coded' elements
""\\server\pdocprogrammes\client_reports\gp1 complete all"" and "".pdf"")
but this didn't work, and neither did
"drName & flName & .pdf"
where drName and flName have previously been defined (see complete code
below)
I'm sure this is just about having the right number of quotes (and/or single
quotes?), but I've tried every combination I can think of and can't get it
to work!!!
Hope someone can help
Many thanks
Les
__________________________________________
The code
Private Sub Command0_Click()
Dim rptName As String
Dim flName As String
Dim drName As String
Dim strName As String
drName = "\\server\pdoc programmes\client_reports\"
rptName = "gp1 complete all"
flName = "gp1 complete all - " & [Forms]![frm x main]![month name]
strName = "test"
'sHandlePDF rptName, flName, drName, strName
ConvertReportToPDF rptName, vbNullString, drName & flName & ".pdf", False
'This works fine:
SendJmail "(e-mail address removed)", _
"", "(e-mail address removed)", "LP11s from PayeDoc",
"Please find attached LP11s for the GP Practices detailed. Many thanks.",
"\\server\pdocprogrammes\client_reports\gp1 complete all.pdf"
'But this does NOT work:
SendJmail "(e-mail address removed)", _
"", "(e-mail address removed)", "LP11s from PayeDoc",
"Please find attached LP11s for the GP Practices detailed. Many thanks.",
"drName & flName & .pdf"
End Sub
I have a procedure Jmail that sends a specified file by email. It works fine
normally. But when I want to include in the filename a value from the
current form, I can't get it to work.
i.e. when the parameter is
"\\server\pdocprogrammes\client_reports\gp1 complete all.pdf"
it works, but when I need to add [forms]![frm x main]![month name] to the
file name I tried:
"""\\server\pdocprogrammes\client_reports\gp1 complete all"" & [forms]!frm x
main]![month name]&"".pdf"""
(i.e. double quotes round the two 'hard-coded' elements
""\\server\pdocprogrammes\client_reports\gp1 complete all"" and "".pdf"")
but this didn't work, and neither did
"drName & flName & .pdf"
where drName and flName have previously been defined (see complete code
below)
I'm sure this is just about having the right number of quotes (and/or single
quotes?), but I've tried every combination I can think of and can't get it
to work!!!
Hope someone can help
Many thanks
Les
__________________________________________
The code
Private Sub Command0_Click()
Dim rptName As String
Dim flName As String
Dim drName As String
Dim strName As String
drName = "\\server\pdoc programmes\client_reports\"
rptName = "gp1 complete all"
flName = "gp1 complete all - " & [Forms]![frm x main]![month name]
strName = "test"
'sHandlePDF rptName, flName, drName, strName
ConvertReportToPDF rptName, vbNullString, drName & flName & ".pdf", False
'This works fine:
SendJmail "(e-mail address removed)", _
"", "(e-mail address removed)", "LP11s from PayeDoc",
"Please find attached LP11s for the GP Practices detailed. Many thanks.",
"\\server\pdocprogrammes\client_reports\gp1 complete all.pdf"
'But this does NOT work:
SendJmail "(e-mail address removed)", _
"", "(e-mail address removed)", "LP11s from PayeDoc",
"Please find attached LP11s for the GP Practices detailed. Many thanks.",
"drName & flName & .pdf"
End Sub