Results 1 to 10 of 10
  1. #1
    Maltheo2005 is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    4

    Runtime Error 424 Object Required

    Hi, I'm new with MS Access stuff and a newbie in this forum. But I need help with my form that works but always come up with an error "424 Object Required".

    I created a pop up data entry form and when the SAVE button is pressed, it inputs the data into a table.
    Here's my vba code and i don't get it why the dialog shows up even though it works fine.



    Code:
    Private Sub ButtonSaveAndExit_Click()
    
    
        CurrentDb.Execute "INSERT INTO Table_INV_2013(recDOE, recRegion,recMC,recType,recNum,recComp)" & _
            " VALUES('" & Me.Auto_Date & "','" & Me.NPSRegion & "','" & Me.NPSMain & "','" & Me.NPSType & "','" & Me.NPSNumber & "','" & _
            Me.TxtComplainant & "')"
            
           
        ButtonCancel_Click
        Records_2013.Form.Requery
        
    
    
    End Sub
    I'm not familiar with vba but I figured out how to construct its structure from the net. Hope someone help me resolve this problem. Thank you.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If you hit debug on the error, what line is highlighted?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Maltheo2005 is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    4
    Quote Originally Posted by pbaldy View Post
    If you hit debug on the error, what line is highlighted?
    when i hit debug it highlights "Record_2013.Form.Requery"

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I assume that's a form? See if using the appropriate syntax from here helps:

    Forms Refer to Form and Subform properties and controls
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Maltheo2005 is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    4
    Quote Originally Posted by pbaldy View Post
    I assume that's a form? See if using the appropriate syntax from here helps:

    Forms Refer to Form and Subform properties and controls
    Yes it's a form, I removed that line and it the error dialog box didn't show up. I now ask what's the purpose of that command? I just watched its tutorial from youtube and i have no idea what it is for.

    Thanks for the link, I'll check that later.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    It's your code, not mine, but I'd assume it's requerying the form to reflect the insert.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Maltheo2005 is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Jun 2013
    Posts
    4
    Quote Originally Posted by pbaldy View Post
    It's your code, not mine, but I'd assume it's requerying the form to reflect the insert.
    I still have no idea abt that. But thank you anyways. The problem is resolved for the meantime.. will get back with tons of questions soon.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem, and welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by Maltheo2005 View Post

    ...The problem is resolved for the meantime...
    Forum etiquette dictates that when you resolve the problem, on your own, you post the resolution! In that way others finding this thread, while researching a similar problem, can benefit from your answer.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I believe that's already been done:

    Quote Originally Posted by Maltheo2005 View Post
    I removed that line and it the error dialog box didn't show up.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 01-31-2013, 01:39 PM
  2. Object Required Error
    By sgp667 in forum Programming
    Replies: 1
    Last Post: 11-06-2012, 03:15 AM
  3. Replies: 13
    Last Post: 06-12-2012, 09:52 PM
  4. Error: Object Required
    By compooper in forum Programming
    Replies: 6
    Last Post: 06-22-2011, 07:52 AM
  5. Object Required Error.
    By Robeen in forum Forms
    Replies: 1
    Last Post: 03-28-2011, 10:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums