J
Jay
I have a form with a subform
the subform's SourceObject is changed to a crosstab query on an after
update event
This means that non of the cotrols exist until this point
I know the name of one control and want to set its after update event after
the source object has been updated
I can get code to list all of the control names in the subform but cannot
get it to change the properties of said controls
here is the code and the 3 ways I have already tried
Me.Controls("sbfrmControl").SourceObject =
"Query.qryContracts_HrsPer_Week_Crosstab"
'attempt 1
Me.Controls("sbfrmControl").Controls("WkNo").BackColor = 1
' attempt 2
Forms![frmContractHours]![sbfrmControl].Form.Controls("WkNo").BackColor = 1
'attempt 3
For Each ctl In Forms![frmContractHours]![sbfrmControl].Form.Controls
If ctl.Name = "WKNO" Then
ctl.BackColor = 255
End If
Next ctl
Is this possible??
the subform's SourceObject is changed to a crosstab query on an after
update event
This means that non of the cotrols exist until this point
I know the name of one control and want to set its after update event after
the source object has been updated
I can get code to list all of the control names in the subform but cannot
get it to change the properties of said controls
here is the code and the 3 ways I have already tried
Me.Controls("sbfrmControl").SourceObject =
"Query.qryContracts_HrsPer_Week_Crosstab"
'attempt 1
Me.Controls("sbfrmControl").Controls("WkNo").BackColor = 1
' attempt 2
Forms![frmContractHours]![sbfrmControl].Form.Controls("WkNo").BackColor = 1
'attempt 3
For Each ctl In Forms![frmContractHours]![sbfrmControl].Form.Controls
If ctl.Name = "WKNO" Then
ctl.BackColor = 255
End If
Next ctl
Is this possible??