Solved

Combo box after update err 424 "Object Required"

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

776 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