the control. The bound controls, for example, create a name using the name of the bound field;
labels create a name using caption text, and so forth:Public Function ControlCS(ctl As Access.Control, _
strPrefix As String, blnTag As Boolean) As IntegerDoes group renaming of all controls with control sources on a form or report.On Error GoTo ErrorHandlerDim strControlSource As StringstrControlSource = Nz(ctl.ControlSource)
pstrOldCtlName = ctl.ControlNameCheck whether control already is correctly named and also special case for controls whose original
name starts with “Option” or “Frame” (same first three letters as prefix).If Left(pstrOldCtlName, 3) = strPrefix And _
Left(pstrOldCtlName, 6) <> “Option” And _
Left(pstrOldCtlName, 3) = strPrefix And _
Left(pstrOldCtlName, 5) <> “Frame” Then
GoTo ErrorHandlerExitIf the control source is not empty, use it.ElseIf strControlSource <> “” Then
pstrNewCtlName = strPrefix & _
StripChars(strControlSource)
ElseOtherwise, use the original control name.pstrNewCtlName = strPrefix & _
StripChars(pstrOldCtlName)
End IfFix name of “Page x of y” textbox controls on Database Wizard reports.If pstrNewCtlName = “txtPagePageofPages” Then
pstrNewCtlName = “txtPages”
End IfShow the usern the original control name
n the control type
n control source
n proposed new namePart III Adding More Functionality to Office