evanscamman
Registered User.
- Local time
- Yesterday, 22:25
- Joined
- Feb 25, 2007
- Messages
- 274
I need to set a control to a given field on a form.
But, the form could either be a form, or a subform.
Is it possible to set a control using the eval function as follows:
If this can't work, is there another command similar to eval that lets you execute a line of code from a string?
I know I could use Forms(strForm).Controls(strControl) - but this doesn't work for a subform.
Thank you,
Evan
But, the form could either be a form, or a subform.
Is it possible to set a control using the eval function as follows:
Code:
Dim ctl as Control
Dim strForm as string
dim strControl as string
strForm = "frmItem!sfrmItemSupplier.Form"
strControl = "UnitPrice"
set ctl = eval("Forms!" & strForm & "!" & strControl)
If this can't work, is there another command similar to eval that lets you execute a line of code from a string?
I know I could use Forms(strForm).Controls(strControl) - but this doesn't work for a subform.
Thank you,
Evan