Advertisement

05.13.2008 at 07:58AM PDT, ID: 23398037
[x]
Attachment Details

Run-time error 438 in Access

Asked by agilebiz in Access Coding/Macros, Microsoft Access Database, Visual Basic Programming

Tags: Microsoft, Access, 2007, VBA, Run-time error '438': Object doesn't support this property or method

This is a method that was working fine about two weeks ago and havent touched it since, now when i was entering info for an employee and went to save and add new i receive this error message.  Here is the code: Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
Private Sub SaveAndAddEmployee_Click()
On Error GoTo Err_SaveAndAddEmployee_Click
    Dim strErrMessage As String
    
    strErrMessage = "Could not save employee due to:"
    
    checkEmpNum (Me.EmployeeNumber)
    
    'if employee number doesnt exist, is not 0 or null then save.
    If Me.EmployeeNumber > 0 Then
        If rsEmployeeCheck.EOF Then
            DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
            DoCmd.GoToRecord , , acNewRec
            MsgBox ("Employee successfully saved.")
        Else
            strErrMessage = strErrMessage & vbCrLf & "- Employee number already exists"
            MsgBox strErrMessage, , "Can't Save Employee"
        End If
    Else
        strErrMessage = strErrMessage & vbCrLf & "- Employee number cannot be 0"
        MsgBox strErrMessage, , "Can't Save Employee"
    End If
        
    
Exit_SaveAndAddEmployee_Click:
    Exit Sub
 
Err_SaveAndAddEmployee_Click:
    If Err.Number = 94 Then 'error number for a null emp number.
        strErrMessage = strErrMessage & vbCrLf & "- Must enter an employee number"
        MsgBox strErrMessage, , "Can't Save Employee"
    Else
        MsgBox Err.message, , "Can't Save Employee" <-- highlighted here
    End If
    Resume Exit_SaveAndAddEmployee_Click
    
End Sub
[+][-]05.13.2008 at 07:59AM PDT, ID: 21555704

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Microsoft Access Database, Visual Basic Programming
Tags: Microsoft, Access, 2007, VBA, Run-time error '438': Object doesn't support this property or method
Sign Up Now!
Solution Provided By: matthewspatrick
Participating Experts: 4
Solution Grade: B
 
 
[+][-]05.13.2008 at 08:04AM PDT, ID: 21555749

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.13.2008 at 08:05AM PDT, ID: 21555757

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.13.2008 at 08:06AM PDT, ID: 21555773

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.13.2008 at 08:09AM PDT, ID: 21555805

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.13.2008 at 08:10AM PDT, ID: 21555814

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628