combo box

raymond3090

Registered User.
Local time
Today, 21:34
Joined
Sep 5, 2002
Messages
43
hi,

I have a combo box that is used to make data entry easier on a form. If the desired item is not present on the list, the user can double click on the field to pop up a new form used to add items to this list.

Currently, the user can type in this field, often trying to enter data, and I have a NotInList event that tells the user to either select on option from the list or double-click to add a new item to it. The trouble is, they already typed out all this info and now need to type it out again! Any suggestions? I would like to use the notinlist property after every character, but the event only checks for this after the field loses focus. Is there a way that I can do my NotInList check after every character so that as soon as their entry differs from mine, my 'add new item' form pops up?

thanks!
 
You should be able to use the Change event which runs each time the control changes -

Private Sub TextBox0_Change
Call NotInList
End Sub

Jon.
 
Hi JonH

Thanks for the response!

I don't understand what my arguments are supposed to be for this call.
 
A better way to do this is to use the openargs property of the entering form ie
On your not in list event. The line where you open the form, change it to

docmd.OpenForm "YourFormName",,,,acFormAdd,,NewData

then on the Form Load of the form to enter data in enter

If not isnull(me.openargs) then
me.NameofFieldfornewdata = NewData
end if

This will then populate the field you want to enter the new item into.

Hope this makes sense.
 

Users who are viewing this thread

Back
Top Bottom