Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2006
    Posts
    48

    Unanswered: Object Required Error Message

    Please tell me why my code fails to run and this error pops up on screen 'Microsoft Office Access OBJECT REQUIRED'. What does it mean?

    This happens on clicking a save command button, with the following code:


    Private Sub Command11_Click()
    On Error GoTo Err_Command11_Click


    EvaluateeNo.Value = Combo2.Value

    If txtMgr.Value Is Not Null Then
    EvaluatorNo.Value = txtMgr.Value
    End If

    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

    Exit_Command11_Click:
    Exit Sub

    Err_Command11_Click:
    MsgBox Err.Description
    Resume Exit_Command11_Click

    End Sub

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    It would be nice to know which line of code the error occurs on.

    I'll guess it's this one:

    If txtMgr.Value Is Not Null Then

    instead try

    If Not IsNull(txtMgr.Value) Then
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Also, you should really try and qualify your controls with the Forms or Me keywords/collections.
    Me.ControlName simply means that it is on the same form as the button calling it (the less we make access guess, the better!)
    Code:
    Me.txtMgr.Value
    Me.EvaluateeNo.Value
    Me.Combo2.Value
    Would be best.

    And if we're being extra picky, give your controls more meaningful name. What the heck is Command_11?!
    George
    Home | Blog

  4. #4
    Join Date
    Jun 2006
    Posts
    48
    Greatly appreciate your prompt assistance.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •