J
Jeff
I'm trying to refer to a control on a nested subform within Access 2003
but get a ""Type Mismatch" error from the following code:
Dim ctl As Control
Dim intYear As Integer
Dim datDate As Date
datDate = Date
intYear = DatePart("yyyy", datDate)
Set ctl = Forms![Main form]![Subform1].Form![Subform2].Form & "!" &
intYear
The last line gives me the error. The name of the control I am
referring to is a year (i.e. 2006). So the last line should set the ctl
to:
Forms![Main form]![Subform1].Form![Subform2].Form!2006
I know this is a simple syntax problem but I can't seem to get around
it. Any help is much appreciated. Thanks.
but get a ""Type Mismatch" error from the following code:
Dim ctl As Control
Dim intYear As Integer
Dim datDate As Date
datDate = Date
intYear = DatePart("yyyy", datDate)
Set ctl = Forms![Main form]![Subform1].Form![Subform2].Form & "!" &
intYear
The last line gives me the error. The name of the control I am
referring to is a year (i.e. 2006). So the last line should set the ctl
to:
Forms![Main form]![Subform1].Form![Subform2].Form!2006
I know this is a simple syntax problem but I can't seem to get around
it. Any help is much appreciated. Thanks.