Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Combo box after update err 424 "Object Required"

Posted on 2004-10-18
4
Medium Priority
?
585 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 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

971 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