Checking if value inserted in combobox is in related table, if not, opening new form

adi2015

Member
Joined
Mar 4, 2015
Messages
17
Programming Experience
3-5
Hi,

in my database I have combobox which shows Patient ID (it contains 13 numerical characters). Field "Patient_ID" is from table called "Patients". This is how combobox looks like

http://s23.postimg.org/5sr8s7utn/18_Apr_15_11_38_33_PM.jpg

If user types already existing Patient ID (in table "Patients"), it can be choosed from combobox, but if he types some NEW Patient ID which doesn't exist in table "Patients", there must be a code which will make that check in background which will do this:

- Check if user has entered NEW Patient ID;
- MsgBox "This Patient ID isn't available, do you want to create new record?";
- Opening form Patients in new record mode with already saved Patient ID in field "Patient_ID";

Any suggesiton is appreciated and many thanks in advance!

With kind regards.
Adi
 
So what have you tried and where exactly are you stuck? Please be specific. For instance, do you not know how to determine whether the value entered by the user is already in the drop-down list? If not then that would be a case of checking the Items collection of the ComboBox to see whether it contains the Text.
 

Latest posts

Back
Top