i appear to be a roadblock here, where my VBA code is producing some weird results.
essentially, everything works perfectly fine except that the first field in the row of the query results in the e-mail contains additional text. that text has the ending string of the path where the app resides.
below is my code:
Dim subj As String
Dim msgbody As String
Dim fs, f
Dim RTFBody
Set fs = Nothing
Set f = Nothing
DoCmd.OutputTo acOutputQuery, "MyQuery", acFormatHTML, "QueryResults.html"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("QueryResults.html", ForReading)
RTFBody = f.ReadAll
f.Close
subj = "MySubject"
msgbody = "Hello," & "<br/>" & "<br/>" & "Can you review the following?" & "<br/>" & "<br/>" & RTFBody
funcDisplayEMail_nosend "", subj, msgbody, , , , , False
below is my result:
Hello,
Can you review the following?
"mypath\app\dev\app.accdb" is just part of the full path of where the app resides.
basically, I'd like to NOT display the app path in the e-mail.
I've seen other examples on how to get this to work, but when I do, I get "too few parameters, expected 2"
thanks!
essentially, everything works perfectly fine except that the first field in the row of the query results in the e-mail contains additional text. that text has the ending string of the path where the app resides.
below is my code:
Dim subj As String
Dim msgbody As String
Dim fs, f
Dim RTFBody
Set fs = Nothing
Set f = Nothing
DoCmd.OutputTo acOutputQuery, "MyQuery", acFormatHTML, "QueryResults.html"
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile("QueryResults.html", ForReading)
RTFBody = f.ReadAll
f.Close
subj = "MySubject"
msgbody = "Hello," & "<br/>" & "<br/>" & "Can you review the following?" & "<br/>" & "<br/>" & RTFBody
funcDisplayEMail_nosend "", subj, msgbody, , , , , False
below is my result:
Hello,
Can you review the following?
MyQuery | |||
Field1 | Field2 | Field3 | Field4 |
Item1mypath\app\DEV\app.accdb | 20 | ||
Item2 | 37 | ||
Item3 | 62 |
"mypath\app\dev\app.accdb" is just part of the full path of where the app resides.
basically, I'd like to NOT display the app path in the e-mail.
I've seen other examples on how to get this to work, but when I do, I get "too few parameters, expected 2"
thanks!