AlexanderBB
Well-known Member
- Joined
- Jul 1, 2009
- Messages
- 1,835
- Office Version
- 2019
- 2016
- Platform
- Windows
I should know this but seem to having a brain fade
How can I pass "frmSerial" as a string to this instruction. To enable the Function add controls to various Forms.
Or must I use something like this
VBA Code:
Set cControl = frmSerial.Frame1.Controls.Add("Forms.Label.1", CName, True)
Or must I use something like this
VBA Code:
Select Case FormName
Case "frmSerial",
Set cControl = frmSerial.Frame1.Controls.Add("Forms.Label.1", CName, True)
Case "frmSomeOtherForm"
Set cControl = frmSomeOtherForm.Frame1.Controls.Add("Forms.Label.1", CName, True)
end select