Results 1 to 2 of 2
  1. #1
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596

    Object Required Error.

    Hi,

    I'm using Access 2010.

    I'm trying to check the value in a combo box when the user tabs off it to make sure something WAS selected [it can't be blank].

    I've got this code:
    Code:
     
    Private Sub cmbDestroyMonth_AfterUpdate()
    Forms!Master!cmbDestroyMonth.SetFocus
    If Forms!Master!cmbDestroyMonth.Value Is Null Then
    in the After Update event of a Combo Box.

    Previously - I had this I simply had:


    Code:
     
    Private Sub cmbDestroyMonth_AfterUpdate()
    Me.cmbDestroyMonth.SetFocus
    If Me.cmbDestroyMonth.Value Is Null Then
    Either way - when I select a value from the list - I get an 'Object Required' error.

    I'm not sure I understand what the problem is.

    I'd appreciate any help I can get.

    Thanks!

    Robeen

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    If someone does not select something from the combo box, the after update event will never fire, so your code will not capture the omission. The code to check to make sure that something was selected in the combo box has to be executed from some other event. I typically use the before update event of the form.

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

Similar Threads

  1. Run-time error '424': Object required
    By cowboy in forum Programming
    Replies: 18
    Last Post: 07-07-2010, 03:32 PM
  2. Replies: 3
    Last Post: 04-15-2010, 09:43 AM
  3. Replies: 3
    Last Post: 03-30-2010, 01:21 PM
  4. Object required
    By duckie10 in forum Access
    Replies: 1
    Last Post: 05-15-2009, 02:11 PM
  5. Replies: 2
    Last Post: 02-28-2009, 03:31 PM

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