S
SF
Hi,
I have a form for user to send mail. There are several fields in the form
such as txtTo, txtCC, txtBCC, txtSubject etc.
I am experience a problem when one the following field is blank.
Private Sub cmdSend_Click()
DoCmd.Hourglass True
Dim olApp As Outlook.Application
Dim olMsg As Outlook.MailItem
Set olApp = New Outlook.Application
Set olMsg = CreateItem(olMailItem)
With olMsg
.To = Me.txtTo
.CC = Me.txtCC >> Error when blank
.BCC = Me.txtBcc >> Error when blank
.Subject = Me.txtSubject
.Body = Me.txtBody
.Send
End With
DoCmd.Hourglass False
TIA
SF
I have a form for user to send mail. There are several fields in the form
such as txtTo, txtCC, txtBCC, txtSubject etc.
I am experience a problem when one the following field is blank.
Private Sub cmdSend_Click()
DoCmd.Hourglass True
Dim olApp As Outlook.Application
Dim olMsg As Outlook.MailItem
Set olApp = New Outlook.Application
Set olMsg = CreateItem(olMailItem)
With olMsg
.To = Me.txtTo
.CC = Me.txtCC >> Error when blank
.BCC = Me.txtBcc >> Error when blank
.Subject = Me.txtSubject
.Body = Me.txtBody
.Send
End With
DoCmd.Hourglass False
TIA
SF