Solved

Combo box after update err 424 "Object Required"

Posted on 2004-10-18
4
574 Views
Last Modified: 2007-12-19
I am trying to control what happens when a user types in something not in the list or backspaces over what they have typed in the combo box and then hit Enter.

The following If in the combo box after update triggers error 424 "Object Required".

If Me![cboReservationID] Is Not Null And Me![cboReservationID] <> "" Then
   'Do some things using cboReservationID
End If

What's up?

Thanks, Lyle


0
Comment
Question by:Faurot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 125 total points
ID: 12339602
Change this:

If Nz(Me.cboReservationID.Column(0), "") <> "" Then
  <do whatever here>
End If

Of course, this only checks whether some value is entered into the combo ... this is not as reliable as the arguments returned by the NotInLIst event. In that event, the NewData argument contains the new information  entered by the user, which you can use to determine if a new record should be added to the combo's underlying recordsource.

0
 
LVL 12

Expert Comment

by:pique_tech
ID: 12339606
Try
If Not IsNull(Me![cboReservationID]) And Me![cboReservationID] <> "" Then
   'Do some things using cboReservationID
End If

Or, even more succinctly,
If Nz(Me![cboReservationID],"") <> "" Then
   'Do some things using cboReservationID
End If



0
 
LVL 16

Expert Comment

by:Nestorio
ID: 12339653
Try this,

Private Sub cboreservationId_AfterUpdate()
If (Not IsNull(Me![cboreservationId])) And Me![cboreservationId] <> "" Then
   'Do some things using cboReservationID
End If

End Sub
0
 

Author Comment

by:Faurot
ID: 12339874
LSMConsulting,

That seems to solve the problem nicely.

Thanks, Lyle
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question