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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FM20.dll causing problems

Status
Not open for further replies.

mguidry5

Technical User
Jan 11, 2005
91
US
Hey guys (and gals),

I'm using some code to send emails with the cdosys.dll, and it works fine in one db that I have. The code uses late binding in case the user doesn't have the cdo reference enabled (and checks to see if cdoex.dll is used instead). Here's the code I'm using:
Code:
Private Sub V_C125_AfterUpdate()
On Error GoTo Err_V_C125_AfterUpdate_Click

    'Dim stDocName As String
    Dim stSendTo As String
    Dim strUser As String
    Dim stSendCC As String
    Dim stSubject As String
    Dim stMsg As String
    Dim ref As Reference
    Dim isref As Boolean
    Dim strRemind As String
    isref = False
    
    'stDocName = "rptAuditFindings"
    stSendTo = "mg100291"
    strUser = fWinXPUserName
    stSendCC = strUser
    stSubject = "V-C125 level at " & Me.V_C125 & "%"
    stMsg = "Please contact Seimens Water Technology to drain V-C125."
    strRemind = "A reminder to empty V-C125 has been sent" & vbCrLf & _
                "to the ESL and copied to your email inbox."

'Enumerate through References collection.
For Each ref In References
     If ref.FullPath = "C:\WINDOWS\System32\cdosys.dll" Then
        isref = True
        Exit For
     ElseIf ref.FullPath = "C:\Program Files\Common Files\Microsoft Shared\CDO\cdoex.dll" Then
        isref = True
        Exit For
     Else
       'do nothing
     End If
Next ref
If isref = False Then
  References.AddFromFile "C:\WINDOWS\System32\cdosys.dll"
End If
    'Refresh form, just in case it needs it.
    Me.Refresh

If Me.V_C125 > 79 Then
    Call SendVC125EMailViaCDO(stMsg, stSendTo, strUser, stSendCC, stSubject, True)
    MsgBox strRemind, vbInformation + vbOKOnly
Else
    'do nothing
End If

Exit_V_C125_AfterUpdate_Click:
    Exit Sub

Err_V_C125_AfterUpdate_Click:
    MsgBox Err.Description
    Resume Exit_V_C125_AfterUpdate_Click
End Sub
In one of my databases, I get the error "Fullpath Method of Object Reference Failed" when this code is triggered. The only difference that I can see between my two databases is that the one producing the error has fm20.dll as a reference. The db won't let me remove this reference, and when I physically remove it from it's file path, the combo box controls in this database cease to function. I can't even remove this reference when it says "MISSING". I'm developing in Access 2003/compatible to 2000. Any ideas?
 
Why did you use an MSForms.ComboBox instead of an Access.ComboBox ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
PHV,

I suppose I could have. I fixed the issue by creating a new database with only the required libraries referenced, and then importing all of my database objects from the old to the new.

That fixed it in my database, but I'm still getting this error on other client computers on my network that try to execute this code. They are running Access 2000, and appear to have the same library references as my computer. I'm nearing my wits end on this one.

Thanks,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top