HighAndWilder
Well-known Member
- Joined
- Nov 4, 2006
- Messages
- 606
- Office Version
- 365
- Platform
- Windows
Hi
I am trying to get the property value of a UserForm Control but using the Control Name and the Property stored
in string variables.
I loop through all Controls on the form and a list of properties for each Control Type and use the last line of code to
assign the property value to the varValue variable. The first six lines of code just support the last line for
demonstration purposes.
Dim strProperty As String
Dim strControlName As String
Dim q As String
q = Chr(34)
strProperty = "Left"
strControlName = "cmdCommandButton"
Evaluate ("varValue = Me.Controls(" & q & strControlName & q & ")." & strProperty)
The value of the property is not assigned to the variable varValue but no error is generated.
Does anybody know what I am doing wrong or can suggest another way to achieve what I want to do.
Thanks
HighAndWild
I am trying to get the property value of a UserForm Control but using the Control Name and the Property stored
in string variables.
I loop through all Controls on the form and a list of properties for each Control Type and use the last line of code to
assign the property value to the varValue variable. The first six lines of code just support the last line for
demonstration purposes.
Dim strProperty As String
Dim strControlName As String
Dim q As String
q = Chr(34)
strProperty = "Left"
strControlName = "cmdCommandButton"
Evaluate ("varValue = Me.Controls(" & q & strControlName & q & ")." & strProperty)
The value of the property is not assigned to the variable varValue but no error is generated.
Does anybody know what I am doing wrong or can suggest another way to achieve what I want to do.
Thanks
HighAndWild