By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,486 Members | 2,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,486 IT Pros & Developers. It's quick & easy.

How to prevent users from modifying data in combo box

P: n/a
I have a combo box look up and list items in a table, it is not bound.

It works fine but how can I prevent the users from entering in there own
data?

i have an 'on change' event that when it changes, it does something else to
a field based on their selection.
I also have the LimitTOList on, but when they click in there, they get an
error first that says the
2110-focus cannot move the focus to this control. (I have the .setfocus
command becuase access wants the focus set to a control when getting data
from it)

SO, why would they get an error?

what to do?
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
OnChange fires with every keypress, but the combo can't check to see if the
selection is valid until the user tries to exit the control, because, of
course, you can't enter XYZ without entering X - Y - and Z, and the entry
isn't valid until the last character is typed.

You probably want to use the AfterUpdate event instead of OnChange - that
event won't fire until the user has actually picked a valid selection from the
list. Also, if Access wants you to have the focus on a control to read its
value, that might mean you are trying to use the .Text property to read the
value rather than the .Value property. In Access, .Text is the text that is
displayed in a control while an edit is in progress, and is only available
when the control has the focus.

On Tue, 20 Apr 2004 15:53:55 GMT, "Danny" <da********@hotmail.com> wrote:
I have a combo box look up and list items in a table, it is not bound.

It works fine but how can I prevent the users from entering in there own
data?

i have an 'on change' event that when it changes, it does something else to
a field based on their selection.
I also have the LimitTOList on, but when they click in there, they get an
error first that says the
2110-focus cannot move the focus to this control. (I have the .setfocus
command becuase access wants the focus set to a control when getting data
from it)

SO, why would they get an error?

what to do?


Nov 12 '05 #2

P: n/a
Thanks again!!

I change everytihng to the .value and it all works.
You really know your stuff

Thanks

"Steve Jorgensen" <no****@nospam.nospam> wrote in message
news:84********************************@4ax.com...
OnChange fires with every keypress, but the combo can't check to see if the selection is valid until the user tries to exit the control, because, of
course, you can't enter XYZ without entering X - Y - and Z, and the entry
isn't valid until the last character is typed.

You probably want to use the AfterUpdate event instead of OnChange - that
event won't fire until the user has actually picked a valid selection from the list. Also, if Access wants you to have the focus on a control to read its value, that might mean you are trying to use the .Text property to read the value rather than the .Value property. In Access, .Text is the text that is displayed in a control while an edit is in progress, and is only available
when the control has the focus.

On Tue, 20 Apr 2004 15:53:55 GMT, "Danny" <da********@hotmail.com> wrote:
I have a combo box look up and list items in a table, it is not bound.

It works fine but how can I prevent the users from entering in there own
data?

i have an 'on change' event that when it changes, it does something else toa field based on their selection.
I also have the LimitTOList on, but when they click in there, they get an
error first that says the
2110-focus cannot move the focus to this control. (I have the .setfocus
command becuase access wants the focus set to a control when getting datafrom it)

SO, why would they get an error?

what to do?

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.