D
DS
I'm running this code with DoEvents, the "Transmitting" form now opens
to where I can see it, but last 2 commands "Close DX and Transmitting"
never happen, it seems that the code just keeps running. Do you have to
close or terminate the Do Events for the 2 forms to close at the end.
Thanks
DS
DoCmd.OpenForm "Transmitting"
DoEvents
'1 Allergys
DoCmd.TransferText acExportDelim, , "Allergys",
'Send Files
Const cdoSendUsingPort = 2
Const cdoBasic = 1
Dim objCDOConfig As Object, objCDOMessage As Object
Dim strSch As String
strSch = "http://schemas.microsoft.com/cdo/configuration/"
Set objCDOConfig = CreateObject("CDO.Configuration")
With objCDOConfig.Fields
.Item(strSch & "sendusing") = cdoSendUsingPort
.Item(strSch & "smtpserver") = "mail.optonline.net"
' Only used if SMTP server requires Authentication
.Item(strSch & "smtpauthenticate") = cdoBasic
.Item(strSch & "sendusername") = "DS"
.Item(strSch & "sendpassword") = "123"
.Update
End With
Set objCDOMessage = CreateObject("CDO.Message")
With objCDOMessage
Set .Configuration = objCDOConfig
.FROM = "Site 1"
.sender = "(e-mail address removed)"
.to = Forms!DX!EmailAddress
.Subject = Date & "" & "Site 1 Famous Restaurant"
.HTMLBody = "Todays Update!"
.AddAttachment "C:\DX\TFILE\DX1Allergys.txt"
.Send
End With
Set objCDOMessage = Nothing
Set objCDOConfig = Nothing
DoCmd.Close acForm, "Transmitting"
DoCmd.Close acForm, "DX"
End Sub
to where I can see it, but last 2 commands "Close DX and Transmitting"
never happen, it seems that the code just keeps running. Do you have to
close or terminate the Do Events for the 2 forms to close at the end.
Thanks
DS
DoCmd.OpenForm "Transmitting"
DoEvents
'1 Allergys
DoCmd.TransferText acExportDelim, , "Allergys",
'Send Files
Const cdoSendUsingPort = 2
Const cdoBasic = 1
Dim objCDOConfig As Object, objCDOMessage As Object
Dim strSch As String
strSch = "http://schemas.microsoft.com/cdo/configuration/"
Set objCDOConfig = CreateObject("CDO.Configuration")
With objCDOConfig.Fields
.Item(strSch & "sendusing") = cdoSendUsingPort
.Item(strSch & "smtpserver") = "mail.optonline.net"
' Only used if SMTP server requires Authentication
.Item(strSch & "smtpauthenticate") = cdoBasic
.Item(strSch & "sendusername") = "DS"
.Item(strSch & "sendpassword") = "123"
.Update
End With
Set objCDOMessage = CreateObject("CDO.Message")
With objCDOMessage
Set .Configuration = objCDOConfig
.FROM = "Site 1"
.sender = "(e-mail address removed)"
.to = Forms!DX!EmailAddress
.Subject = Date & "" & "Site 1 Famous Restaurant"
.HTMLBody = "Todays Update!"
.AddAttachment "C:\DX\TFILE\DX1Allergys.txt"
.Send
End With
Set objCDOMessage = Nothing
Set objCDOConfig = Nothing
DoCmd.Close acForm, "Transmitting"
DoCmd.Close acForm, "DX"
End Sub