Combobox warning if more than one item is available

Wysy

Registered User.
Local time
Yesterday, 18:09
Joined
Jul 5, 2015
Messages
335
Hi,
i have the following question:
I have a form with a combobox that is based on a query. It contains customers and addresses. However there are customers with the same name, but of course with different address. By pressing ALT+ down arrow i have the list and can select the one i want. However i would like to have a warning message before updating the combobox if the entered name has multiple entries. How do i accomplish it?
regards
Andrew
 
You can put msgbOx on either before update or after update event of the combo but you cannot revert it back.

you use dcount against the source table of the combobox:

Private sub combo_afterupdate()
If dcount("1", "sourcetable", "namefield=""" & me.combo & """") > 1 then
Msgbox "Name you selected has many entry in the list"
End if
End sub
 
Thank you! That is what i was missing.
 

Users who are viewing this thread

Back
Top Bottom