This is possibly a very simple thing I am trying to do, but for the life of me I can't seem to get it right. I am trying to set the name of a control in vba and then set it's value to a stored value.
Method 1 (Which Works)
eg.
Dim MyCtl as Control
Dim MyFrm as Form
Set MyFrm = "frmABC"
Set MyCtl = Forms!frmABC.fieldname
Method 2 (Won't work)
eg.
Dim MyCtl as Control
Dim MyFrm as Form
Dim anyFrm
anyFrm = "frmABC"
Set MyFrm = anyFrm
Set MyCtl = MyFrm.fieldname
Both setting MyFrm and MyCtl produce the same error,Error 424, Object required.
Thanks in advance
Method 1 (Which Works)
eg.
Dim MyCtl as Control
Dim MyFrm as Form
Set MyFrm = "frmABC"
Set MyCtl = Forms!frmABC.fieldname
Method 2 (Won't work)
eg.
Dim MyCtl as Control
Dim MyFrm as Form
Dim anyFrm
anyFrm = "frmABC"
Set MyFrm = anyFrm
Set MyCtl = MyFrm.fieldname
Both setting MyFrm and MyCtl produce the same error,Error 424, Object required.
Thanks in advance