change LimitToList Property in runtime

M

Martin

Hi,
I am trying to change the property LimitToList of a unbound combobox in
runtime, but it doesn't work.
"Microsoft Access can't set the LimitToList property to No right now."

Why? Access Help doesn't say that we cannot change this property in runtime.
What can I do?

Thanks
Martin
 
G

Guest

I believe you'll need to open the form in design view, change the LimitToList
property, and reopen in form view (this can all be done programmatically;
precede the code with 'DoCmd.Echo False' and close it with 'DoCmd.Echo True'
once the rest of the code is running OK)

Out of curiosity, is there a reason for changing the property in runtime?
Another possible solution would be to have an 'OnLostFocus' event on the
combo box itself so that, if the conditions exist which demand a 'limit to
list', you can test whether the value is in the list & react accordingly -
otherwise, when 'limit to list' isn't necessary, the test is bypassed. A bit
more coding needed, but probably faster for the user.

Any help?
 
R

Rick Brandt

Martin said:
Hi,
I am trying to change the property LimitToList of a unbound combobox
in runtime, but it doesn't work.
"Microsoft Access can't set the LimitToList property to No right now."

Why? Access Help doesn't say that we cannot change this property in
runtime. What can I do?

Not many, but a few properties can only be changed in design view.
LimitToList might be one of them. Instead just have two identical
ComboBoxes. One with LTL true and one with LTL false and toggle which one
is visible.
 

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