combobox - limit to list?

J

Junior

Hi - I have my cbo boxes limit to list set to yes - thinking that would stop
entering of other selections
I just discovered some records in my DB that users somehow managed to enter
a selection not on the list

I tried the cbo in question and the available selections are listed NV,V,
etc. (only about 6 possible)
I was able to type the 'no' (the offendiong entry that i found) into the
cbo -
a popup message warned that the selection was not on the list and returned
focus to the cbo - however, the 'no' remained in the cbo.

I want to make sure that users CANNOT somehow enter a value that is not on
the list- since i compute other fields based on this field -
What else can i do to be sure ?? thanks in advance for advice
 
F

fredg

Hi - I have my cbo boxes limit to list set to yes - thinking that would stop
entering of other selections
I just discovered some records in my DB that users somehow managed to enter
a selection not on the list

I tried the cbo in question and the available selections are listed NV,V,
etc. (only about 6 possible)
I was able to type the 'no' (the offendiong entry that i found) into the
cbo -
a popup message warned that the selection was not on the list and returned
focus to the cbo - however, the 'no' remained in the cbo.

I want to make sure that users CANNOT somehow enter a value that is not on
the list- since i compute other fields based on this field -
What else can i do to be sure ?? thanks in advance for advice

In the Combo Box's NotInList event:

MsgBox "You have entered a value not on the list." & vbNewLine &
"Select a value from the list."
Me![ComboName] = Me![ComboName].OldValue
Response = acDataErrContinue

or you could use ....
Me![ComboName] = Null

It depends upon what you want to happen if there is existing data in
the field that the user is attempting to change.
OldValue will restore an existing valid value.
Null will remove an old value.
 
J

Jim Allensworth

Hi - I have my cbo boxes limit to list set to yes - thinking that would stop
entering of other selections
I just discovered some records in my DB that users somehow managed to enter
a selection not on the list

I tried the cbo in question and the available selections are listed NV,V,
etc. (only about 6 possible)
I was able to type the 'no' (the offendiong entry that i found) into the
cbo -
a popup message warned that the selection was not on the list and returned
focus to the cbo - however, the 'no' remained in the cbo.

I want to make sure that users CANNOT somehow enter a value that is not on
the list- since i compute other fields based on this field -
What else can i do to be sure ?? thanks in advance for advice
If your combo is indeed set to limit to list, then you can't add
anything else. Even though your entry ("no") was there after the
warning you should not be able to navigate out of it without pressing
the {Esc} key - without getting another warning.

Investigate how the users might be able to modify data otherwise, for
example can they get to the tables? {F11}

- Jim
 

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