Run-Time error 438- Object doesn't support this property or method

barbados2010

Registered User.
Local time
Today, 13:15
Joined
Sep 7, 2012
Messages
16
Long story short, my DB was working fine until I exported a new form from another DB (same DB, just another file) into my current DB and replaced it. Now when I click a record to open it I receive the error "Object doesn't support this property or method"

how can i fix this??

the vba opens and this code seems to be a problem:
Code:
Form_Load_Error:
    Call ErrorLog(Err.Name, Err.Number, Me.Name, Erl, "Form_Load") [B]<[/B]t[B]his line highlighted in yellow[/B]
    Resume Form_Load_Exit
End Sub

Full code:
Code:
Private Sub Form_Load()
'If OpenArgs exists, search for ID that has been passed
'Also used to auto-populate fields when creating new record
'E.g.   "1" would load record ID 1
'       "0|CompanyID~2" would create a new record and populate CompanyID with ID 2
'       "0||NewSimple" would create a new record, not populate anything, and open form in Simple mode
' 10/26/10 Added extra parameter to get form that launched this form, currently used for getting sort order
'       "1|||frmCompanyList" means that record ID 1 was opened from frmCompanyList
'       "1|||frmCompany~subCompanyContact" means that record ID 1 was opened from subform subCompanyContact in frmCompany

    If IsDebugMode = 0 Then On Error GoTo Form_Load_Error

    Dim varOpenArgsRecord As Variant
    Dim varOpenArgsPopulate As Variant
    Dim intOpenArgsValues As Integer

    Me.Caption = Entity

    If Not IsNull(Me.OpenArgs) Then
        varOpenArgsRecord = Split(Me.OpenArgs, "|")
        'If form name has been provided, check for sort order
        If UBound(varOpenArgsRecord) > 2 Then
            If Nz(varOpenArgsRecord(3), "") <> "" Then    'Is a form name provided
                Call SetFormSort(CStr(varOpenArgsRecord(3)), Me.Name)
            End If
        End If
        If (varOpenArgsRecord(0) <> "0") Then
            DoCmd.SearchForRecord acForm, Me.Name, acFirst, "[" & Entity & "ID]=" & varOpenArgsRecord(0)
            Call ShowNavigation(True, Me.Name)
        Else
            'Pre-populated fields
            If UBound(varOpenArgsRecord) <> 0 Then
                varOpenArgsPopulate = Split(varOpenArgsRecord(1), "~")
                For intOpenArgsValues = 0 To UBound(varOpenArgsPopulate) Step 2
                    Me.Controls(varOpenArgsPopulate(intOpenArgsValues)) = varOpenArgsPopulate(intOpenArgsValues + 1)
                Next
            End If
        End If
        'Check for "NewSimple"
        If UBound(varOpenArgsRecord) > 1 Then
            If varOpenArgsRecord(2) = "NewSimple" Then
                Me.TabControl.Style = 2
                Me.TabControl.TabFixedHeight = 0
            End If
        End If
    End If

Form_Load_Exit:
    Exit Sub

Form_Load_Error:
    Call ErrorLog(Err.Name, Err.Number, Me.Name, Erl, "Form_Load")
    Resume Form_Load_Exit
End Sub
 
Try Err.Description instead of .Name.
 
Is the "ErrorLog" function in the new DB as it was (with the same arguments) in the original?

The obvious is often overlooked.
 
do not forget that Name is a reserved word, change it for NName for instance
 

Users who are viewing this thread

Back
Top Bottom