M
mbuelsing
I've got a complicated Access form with numerous subforms. The client
would like to require data input on some fields being displayed on the
form before the record(s) is saved. The fields he chooses could be on
the main form or a subform. I have figured out a procedure that will
record the control reference to the text box he chooses as being a
required field and I store that reference as a string in a table. Like
this
Fieldname=ControlRef
Field value = "Forms!frmEvent.tbFirstName"
The question is, how to assign a control object to that control the
string points to so I can get the control's value and check for nulls
and empties.
I have tried:
strReference = "Forms!frmEvent.tbFirstName"
Dim ctl as control
set ctl = strReference
But the string is not translated into the object. There is an error
message.
How do I use a string variable to set the object?
Thanks in advance!
would like to require data input on some fields being displayed on the
form before the record(s) is saved. The fields he chooses could be on
the main form or a subform. I have figured out a procedure that will
record the control reference to the text box he chooses as being a
required field and I store that reference as a string in a table. Like
this
Fieldname=ControlRef
Field value = "Forms!frmEvent.tbFirstName"
The question is, how to assign a control object to that control the
string points to so I can get the control's value and check for nulls
and empties.
I have tried:
strReference = "Forms!frmEvent.tbFirstName"
Dim ctl as control
set ctl = strReference
But the string is not translated into the object. There is an error
message.
How do I use a string variable to set the object?
Thanks in advance!