Solved

Combo box after update err 424 "Object Required"

Posted on 2004-10-18
4
569 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
LSMConsulting,

That seems to solve the problem nicely.

Thanks, Lyle
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now