Hi Guys,
I'm trying on the NotInList event in combobox. my combox contain ID Numbers.
when I'm entering a new ID in the combobox it
doesn't allow it. I have read that I can do
that using the NotInList event and I found a
code for it. but it's doesn't work.
Does anyone know a code that works?
following you can find the code that I have
used:
http://support.microsoft.com/default.aspx?scid
=kb;en-us;197526
this is the part that I have problem with:
[COLOR=DarkRed][B] ' Look for the customer
the user created in the Customers form.
Result = DLookup("[CompanyName]", "
Customers", _
"[CompanyName]='" & NewData & "'")
If IsNull(Result) Then
' If the customer was not created, set
the Response argument
' to suppress an error message and undo
changes.
Response = acDataErrContinue
' Display a customized message.
MsgBox "Please try again!"
Else
' If the customer was created, set the
Response argument to
' indicate that new data is being added.
Response = acDataErrAdded
End If[/B][/COLOR]
my problem :
when I enter a new ID it asks me if I want to
add it to the combobox. however when I click on
Yes it gives me the "Please try again!"
message.
Any help will be very much appreciated!
Regards,
CS.
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).