From outside of the form's class code module, to get the width (in inches) of a control on the form do it like this:
Code:
Public Function fcnProp()
Dim frm As Object
Dim fld As Object
Set frm = Forms("frmGuestInformation")
Set fld = frm("txtFirstName")
fcnProp = fld.Width / 1440
Debug.Print fcnProp
End Function
The code could be modified to have the function receive argument strings for the form name, control name and property name, like this:
Use would be like:
Code:
MyControlProp = fcnProp("frmMyForm","aTextBox","Width") / 1440 'twips returned, divide by 1440 to get inches
Public Function fcnProp(fName As String, fFld As String, fProp As String)
Dim frm As Object
Dim fld As Object
Set frm = Forms(fName)
Set fld = frm(fFld)
fcnProp = fld.Properties(fProp)
Debug.Print fcnProp
End Function