MS ACCESS:在电子邮件中放置当前记录的字段值 "Subject"
MS ACCESS: Placing a field value of current record in the e-mail "Subject"
我有以下代码可以通过电子邮件发送报告 (pdf)。
代码工作正常!但是,我希望我发送的当前记录的一个字段成为电子邮件主题的一部分。我已经尝试了很多东西,但没有任何效果。
当前主题是"Order is ready!"
我希望这是 "Order [ordernumber] is ready!"
Private Sub sendesoreq_Click()
Dim stDocName As String
stDocName = "orderfinished_2"
DoCmd.OpenReport stDocName, acPreview, , "[orderID] = " & Me.orderID
DoCmd.SendObject acSendReport, "orderfinished_2", ".pdf",
"mymail@gmail.com", , , "Order is ready!", "Success! The
following order is ready for shipment. Thank you!", False
Me.orderstatuscombo.Value = "ESO request sent"
End Sub
提前谢谢大家!
只需使用字符串连接来插入您的字段
而不是:
"Order is ready!"
使用
"Order #" & Me.orderID & " is ready!"
我有以下代码可以通过电子邮件发送报告 (pdf)。 代码工作正常!但是,我希望我发送的当前记录的一个字段成为电子邮件主题的一部分。我已经尝试了很多东西,但没有任何效果。
当前主题是"Order is ready!"
我希望这是 "Order [ordernumber] is ready!"
Private Sub sendesoreq_Click()
Dim stDocName As String
stDocName = "orderfinished_2"
DoCmd.OpenReport stDocName, acPreview, , "[orderID] = " & Me.orderID
DoCmd.SendObject acSendReport, "orderfinished_2", ".pdf",
"mymail@gmail.com", , , "Order is ready!", "Success! The
following order is ready for shipment. Thank you!", False
Me.orderstatuscombo.Value = "ESO request sent"
End Sub
提前谢谢大家!
只需使用字符串连接来插入您的字段
而不是:
"Order is ready!"
使用
"Order #" & Me.orderID & " is ready!"