change LimitToList Property in runtime

  • Thread starter Thread starter Martin
  • Start date Start date
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
 
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?
 
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.
 
Back
Top