R
rmanchu
guys, what's going on here?
as u can c, some controls r being hit more than once and some not at
all!!!
For Each ctlTD In Forms(varT.Name).Controls
If ctlTD.ControlType = Access.acTextBox _
Or ctlTD.ControlType = Access.acComboBox _
Or ctlTD.ControlType = Access.acCheckBox Then
strTD = ctlTD.ControlSource
Debug.Print strTD 'out res
If Len(strTD) > 0 Then
strTD = Mid$(strTD, InStr(1, strTD, "_"))
strTD = frmPrefix & strTD
ctlTD.ControlSource = strTD
ctlTD.Name = strTD
ctlTD.Controls(0).Name = strTD & "_Label"
End If
End If
Next ctlTD
Output:
BN_OwnerStaff
BN_OwnerSection
BN_TimeStamp
BN_Progress
BN_Rejected
BN_ReqIdent
BN_Phone
BN_ReqAddressCD
BN_RegNameE
BN_CollDate
BN_OwnerSection
BN_Progress
BN_ReqIdent
BN_ReqAddressCD
BN_CollDate
BN_Progress
BN_ReqAddressCD
BN_Progress
BN_Progress
as u can c, some controls r being hit more than once and some not at
all!!!
For Each ctlTD In Forms(varT.Name).Controls
If ctlTD.ControlType = Access.acTextBox _
Or ctlTD.ControlType = Access.acComboBox _
Or ctlTD.ControlType = Access.acCheckBox Then
strTD = ctlTD.ControlSource
Debug.Print strTD 'out res
If Len(strTD) > 0 Then
strTD = Mid$(strTD, InStr(1, strTD, "_"))
strTD = frmPrefix & strTD
ctlTD.ControlSource = strTD
ctlTD.Name = strTD
ctlTD.Controls(0).Name = strTD & "_Label"
End If
End If
Next ctlTD
Output:
BN_OwnerStaff
BN_OwnerSection
BN_TimeStamp
BN_Progress
BN_Rejected
BN_ReqIdent
BN_Phone
BN_ReqAddressCD
BN_RegNameE
BN_CollDate
BN_OwnerSection
BN_Progress
BN_ReqIdent
BN_ReqAddressCD
BN_CollDate
BN_Progress
BN_ReqAddressCD
BN_Progress
BN_Progress