Solved

Combo box after update err 424 "Object Required"

Posted on 2004-10-18
4
573 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
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

821 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