how to protect a combobox (1 Viewer)

exaccess

Registered User.
Local time
Today, 11:47
Joined
Apr 21, 2013
Messages
287
Hi experts,
I have the following problem. I have a form that contains a combo box and a run command button. The combo box has a lookup table used rowsource for the combo. The combo has 2 columns and can have many rows. What I want to do is to protect the combo against any data entry and have the user use only the values in the dropdown list of combo. What is the easiest way of doing this. I have many cases like this throughout the project.
 

Minty

AWF VIP
Local time
Today, 10:47
Joined
Jul 26, 2013
Messages
10,353
Set the allow list edits property to no, and Limit to List to Yes.
 

exaccess

Registered User.
Local time
Today, 11:47
Joined
Apr 21, 2013
Messages
287
Set the allow list edits property to no, and Limit to List to Yes.
By "allow list edits" do you mean "allow value list edits"? If yes I set it to "no".
"Limit to List" is yes. But still does not work.
 

Minty

AWF VIP
Local time
Today, 10:47
Joined
Jul 26, 2013
Messages
10,353
What isn't working? If the combo box is set to Limit to list = Yes , and Allow Value List Edits = No , then the end user cannot change the values that are available.

Are you trying to prevent them from changing an already set value ?
 

exaccess

Registered User.
Local time
Today, 11:47
Joined
Apr 21, 2013
Messages
287
What isn't working? If the combo box is set to Limit to list = Yes , and Allow Value List Edits = No , then the end user cannot change the values that are available.

Are you trying to prevent them from changing an already set value ?
Precisely when the user comes to the form he should not see anything in the combo field.

-If he hits enter then the application gives error message but stays on the same form.

-If he tries to write something in the combo it is not allowed

-If he hits the small arrow the list drops down, he selects a row and finally hits the command button. This is what he is expected to do. I am attaching a screen shot of the relevant tab of properties of the combo as it is now.
 

Attachments

  • screenshot.49.jpg
    screenshot.49.jpg
    46.5 KB · Views: 143

Minty

AWF VIP
Local time
Today, 10:47
Joined
Jul 26, 2013
Messages
10,353
You can Always type something into a combobox if it's not locked, but if it's not in the list it won't store it.
If you want to remove the ability to type in the box, change the control type to a list box.
 

exaccess

Registered User.
Local time
Today, 11:47
Joined
Apr 21, 2013
Messages
287
You can Always type something into a combobox if it's not locked, but if it's not in the list it won't store it.
If you want to remove the ability to type in the box, change the control type to a list box.

Oh I see the problem now. So whatever you type in you get an error message. If you change the locked property then you cannot enter any data using the combo. The enable property is similar. Thus result is either this behavior should be tolerated or a listbox should be used. Do I get it correct?
 

Minty

AWF VIP
Local time
Today, 10:47
Joined
Jul 26, 2013
Messages
10,353
Yes - you have the behaviour correctly described.
 

Users who are viewing this thread

Top Bottom