Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another Access Error

Status
Not open for further replies.

danitrin

Programmer
Jan 21, 2005
5
US
I have one user who is using Access 97 on Windows NT. When attempting to send a email via automation from Access, she gets the following message "Variable uses an automation type not supported by Visual Basic".

I don't think this a code issue becase this same feature works fine on everyone elses pc in the department who is also using either NT or Win. 2000.
 
An error message without the offending line of code (or surrounding lines of code) is pretty hard to troubleshoot. If you are trying to solve the problem without visibility of the code then you have your work cut out for you.

Clearly something in the user's PC is different to the others. Since it's an automation issue, it is bound to be tied up with something in her Outlook setup.

Can you provide the offending code?
 
This is the code, I deleted some of it due to security issues:

Private Sub cmdSendEmail_Click()
On Error GoTo Err_cmdSendEmail_Click

Dim stDocName As String

Dim strCustomer As String
Dim strEmail As String
Dim strMessage As String
Dim strSubject As String
Dim blnDeleteSent As Boolean
Dim blnDisplayMsg As Boolean
Dim blnReadReceipt As Boolean
Dim strEmailCC As String
Dim strBSOname As String
Dim strDate As String
Dim intResponse As Integer
Dim strCollateral As String
Dim strIneligible As String
Dim strProcessingMessageID As String




intResponse = MsgBox("WARNING: This process will send an email to the client." & vbLf & _
"Do you wish to coninue?", vbYesNo, "Processing Notice")
If intResponse <> vbYes Then
MsgBox "Processing Notice has been cancelled.", vbOKOnly
Exit Sub
End If

'Preview email message prior to sending if box is checked
If chkPreviewEmail = True Then
blnDisplayMsg = True
Else
blnDisplayMsg = False
End If

'Request read receipt to be sent if box is checked
If chkReadReceipt = True Then
blnReadReceipt = True
Else
blnReadReceipt = False
End If

'Send email but only save in Sent messages if box is checked on
If chkSaveSentMessage = True Then
blnDeleteSent = False
Else
blnDeleteSent = True
End If


strCustomer = cbocustomer.Column(1)
strEmail = [Primary Email]
strEmailCC = [LoanOfficerEmail]



strCollateral = Format([CollateralLoanValue], "$###,###,###,###")
strIneligible = Format([Ineligibles], "$###,###,###,###")

Select Case ReportingFrequency & " Client-" & cboReportingPeriod & " Rept"
Case "******** Client-Monthly Rept"
strProcessingMessageID = "1"
strSubject = Subject goes here
strMessage = Message goes here

Case "*******Client-Weekly Rept"
strProcessingMessageID = "2"
strSubject = Subject goes here
strMessage = Message goes here

Case "*******Client-Monthly Rept"
strProcessingMessageID = "3"
strSubject = Subject goes here
strMessage = Message Goes Here

Case "***** Client-Monthly Rept"
strProcessingMessageID = "4"
strSubject = Subject goes here
strMessage = Message goes here

Case "******Client-Weekly Rept"
strProcessingMessageID = "5"
strSubject = "Subject Goes here
strMessage = Message goes here

End Select




SendEmail blnDisplayMsg, blnDeleteSent, blnReadReceipt, strCustomer, strEmail, strEmailCC, strSubject, strMessage


'Log the email in the Processing Notices Sent table
CurrentDb.Execute " Insert into tblProcessingNoticeSent " & _
"(DateSent, Sentby, CustomerID,ReportingPeriod,LoanBaseDate, " & _
"CollateralLoanValue, Ineligibles, ProcessingNoticeMessageID, ContactEmail," & _
"BSOName, BSOEmail) VALUES" & _
"(#" & Date & " " & Time & "#,'" & _
stroutlooksender & "','" & _
Forms!frmProcessingNotice.cbocustomer & "', '" & _
Forms!frmProcessingNotice.cboReportingPeriod & "', '" & _
Forms!frmProcessingNotice.LoanBaseDate & "', '" & _
Forms!frmProcessingNotice.CollateralLoanValue & "', '" & _
Forms!frmProcessingNotice.Ineligibles & "', '" & _
strProcessingMessageID & "','" & _
Forms!frmProcessingNotice.[Primary Email] & "','" & _
Forms!frmProcessingNotice.[LoanOfficer] & "','" & _
Forms!frmProcessingNotice.[LoanOfficerEmail] & "');"
Exit_cmdSendEmail_Click:
Exit Sub

Err_cmdSendEmail_Click:
MsgBox Err.Description
Resume Exit_cmdSendEmail_Click

End Sub
 
danitrin,

1.For DateSent I would use Now() instead of Date & " " & Time

2.For numeric values don't use [red]'[/red]

3.SendEmail is the procedure call producing the error?? As PCLewis said Since it's an automation issue, it is bound to be tied up with something in her Outlook setup..I cant see how you send the mail though......
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top