resetting form control properties to original design-time default values

  • Thread starter Thread starter Robert M via AccessMonster.com
  • Start date Start date
R

Robert M via AccessMonster.com

I have a form where during usage I will change certain control property
values to something other than the original design-time default values.
Under certain circumstances during run-time I want to change them back to the
original values - specifically the Enabled property. How do I do this?
 
pretty much the same way you altered the settings at runtime, in the first
place.

Me!ControlName.SomeProperty = SomeValue

if you're having trouble with a specific sequence of actions/events, please
post details of what you're doing, what code is running, what error messages
or unwanted result you're getting.

hth
 
This works. What I was trying to do is to restore the orignal default .Value
and the .Enabled property to
certain form controls.

' restore original form control .Value and .Enabled property
Function EnumFrmCtls_Defaults()
Dim frmCtl As Control
Dim strFrmCtlName As String
For Each frmCtl In Me.Controls
If (TypeOf frmCtl Is CheckBox) Or _
(TypeOf frmCtl Is TextBox) Or _
(TypeOf frmCtl Is ComboBox) Then
strFrmCtlName = frmCtl.Name
Me(strFrmCtlName).Enabled = frmCtl.Properties![Enabled].Value '
original Enabled property
Me(strFrmCtlName).Value = Me(strFrmCtlName).DefaultValue '
original value
End If
Next frmCtl
EnumFrmCtls_Defaults = "OK"
Exit Function
End Function
 
Back
Top