I have looked for a sub or func to reset property defaults back to the default in the Property Sheet, but without any luck. Similar to what would happen if you closed the form and reopened it, except I do not want to close the form. I have a different sub that sets the controls to NULL.
This works but looks less than ideal.
I tried to simplify this sub with following
but does stops at
The error message is Syntax Error. I tried to enclose in [] and () or just one "...", but Syntax Error at the same line.
Thanks
This works but looks less than ideal.
Code:
Private Sub SetDefaults()
Me.txtUnit1.Enabled = True
Me.txtUnit2.Enabled = True
Me.txtUnit3.Enabled = True
Me.txtUnit4.Enabled = True
Me.txtUnit5.Enabled = True
Me.txtUnit6.Enabled = True
Me.txtUnit7.Enabled = True
Me.txtUnit8.Enabled = True
Me.txtUnit9.Enabled = True
Me.txtUnit10.Enabled = True
Me.txtUnit11.Enabled = True
Me.txtUnit12.Enabled = True
End Sub
I tried to simplify this sub with following
Code:
Private Sub SetDefaults()
Dim i As Integer
Dim regNumber As Integer
Dim strControlName As String
strControlName = "txtUnit"
regNumber = 12
For i = 1 To regNumber
Me."strControlName" & "i".Enabled = True
Next i
End Sub
but does stops at
Code:
Me."strControlName" & "i".Enabled = True
Thanks