If combo box pick is not in list in access

V

Vitamin Ed

I have setup a DB in Access that compairs the UPC code on the bottom of the
bottle to the UPC code on the label making sure they match. What I am having
problems with is when its not in the combo list I need it to go to another
field and not use the default message. I am using a bar code reader to input
the information in the combo box and people have a tendancy to ignor the
default message. I want them to go to another field and let nothing work
until they press a button.
If anyone has a suggestion I need help.

Thank you,
 
R

rj

I believe I have a similar problem for which the solution is the same. I have
an item list in a combo box on a form. If the person types in a name that is
not on the list, they get an error. What I would like to do is for Access to
automatically add the name to the item list if it's not already there.
Alternatively, I could store the item list in a separate table and call an
AddRecord routine I don't know the syntax for that) that would add the name
and then return back to the form allowing the person to tab to the next field
or click on a new field.

Thanks,
Randy Johnson
 
D

Douglas J. Steele

You need to put logic in the combo box's NotInList event to intercept the
standard message and replace it with your own.
 
R

rj

Just to be clear, I put "value list" in the Row Source Type field, and an
initial list of items in the Row Source field. What you are saying is that I
have to delete that and create a linked table with the list of items. Then
put that code on the mvps site that you showed me in the Not in List event
field with the appropriate modifications of the dbname, etc.

ie, i can't use the raw source type field if i want to dynamically add names
to the list?

thanks,
rj
 
R

rj

Please ignore my prior post. I would edit or delete it but i don't see a
edit/delete button anywhere.

I put "Table/Query" in the Raw Source Type field. The Raw Source field
contains the code generated from the combo box wizard, "SELECT
Store.Store_ID, Store.StoreName FROM Store;"

So i've done away with the valuelist type.

thanks,
rj
 
V

Vitamin Ed

I want to thank everyone that gave me some good ideas. I think I found a way
around it. What I did was to write a macro to go to another form that I set
up so the only thing on the form that would do anything it the reset button.
I then went to the first form and opened its properties event section an used
the macro in the on error. It seems to work fine now. Again that to all who
tried to help.

Vitamin Ed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top