Resetting control properties

C

Carlos

Is there a method to reset the properties of all controls
on a form to those listed in the property sheet. The
situation is this:
The .visible and .caption properties of some controls are
changed depending on the option chosen in a combo box.
But when the user moves to another record, I want the
properties of the changed controls to revert back to their
original values.

Thank you muchly,

Carlos
 
S

ScottE

I would try somethnig like this for visibility when the
user moves to a new record:

Dim ctl As Control

For Each ctl In Forms!myform.Controls
ctl.visible = {true/false}
Next ctl

Depending on the number of controls, you could do a couple
of things. If the captions are simple, name them the same
as their captions and include the following in the above:

ctl.caption = ctl.name

Or, do it the hard way and manually reset the caption for
each.

Hope this helps!

- Scott
 

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