[AccessD] CBO Not In List

Rocky Smolin - Beach Access Software bchacc at san.rr.com
Thu Oct 2 09:06:12 CDT 2003


In the OnChange even of a combo box called cboAssetType I put the following
code:

    rstAssetType.FindFirst "fldAssetTypeDescription LIKE '" &
cboAssetType.Text & "*'"

    If rstAssetType.NoMatch = True Then
        MsgBox "There is No Asset Type With That Description", vbExclamation
        SendKeys Chr(8)
        cboAssetType.Dropdown
    End If

Of course, the recordset rstAssetType has already beed opened in the OnOpen
event of the form which maintains asdsset types.

HTH

Rocky Smolin
Beach Access Software

----- Original Message ----- 
From: "John Colby" <jcolby at colbyconsulting.com>
To: "AccessD" <AccessD at databaseadvisors.com>
Sent: Thursday, October 02, 2003 6:29 AM
Subject: [AccessD] CBO Not In List


> I want to use the NotInList to open an initial data entry form if the
person
> searched for isn't in the database, else open a tabbed form if they are.
I
> have this working using NotInList to open the IDE form and the after
update
> to open the tabbed form to the record of the person found in the combo.
>
> However, what I want to do now is to have the combo start beeping as the
> person types if the item is not in the list.  IOW, NotInList only fires as
> the user EXITS the combo and the item is not in the list.  However if the
> user is typing in a person's name - JOHN COLBY, and by the time she types
> the O in COLBY the combo is not finding the name, the combo should start
> beeping so that the user is notified to stop typing and tab out to trigger
> NotInList and open the data entry form - or even programatically tab out
and
> trigger the NotInList.
>
> It seems like it could be accomplished by checking the insertion point and
> the length of the data in the combo.  If the data exists, the insertion
> point is in the middle of the data that the combo is following, whereas as
> soon as the data is not found, the insertion point is at the end of the
> data.  IOW, if the insertion point is at the end of the data TWICE, then
we
> are at a true "not found" and trigger NotInList.  In fact it seems like
the
> combo should have been built this way to begin with.
>
> Has anyone ever done this?
>
> John W. Colby
> www.colbyconsulting.com
>
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>



More information about the AccessD mailing list