renames labels to include controlname. Associated labels are named with the controlname first and unassociated labels have 'Label_' first.

FORM:

must be in design view

must be active

This is designed so you can run the code while the form you want to change is in design view and active. Compile the code before running. Then run and compile again. Most likely, changes will be needed in the code behind the form that was just changed -- you can either fix things or, if you don't like what happened, the form can be closed without saving.

Be sure to check the control Subs behind the form (ctrl-home to go to top, drop procedures list in upper right and see if there are names like 'myoldcontrolname_AfterUpdate' which means it is not hooked up to anything -- otherwise you would have to navigate to the code via the object list dropdown in the upper left then the event dropdown in the upper right) to make manual changes to the sub names in the declaration line. After compiling and saving, ensure that [Event Procedure] is where it needs to be on the Property Sheet. If it is not, type "[" in the property to trigger Access to fill it in. Just because the code is behind the form does not mean it is still 'hooked up'. Once you have changed all procedures with event names in the general list, you can be sure everything is hooked up. Avoid naming your custom routines in a way that looks like they belong to control events.

At some point, I hope to hook in my code documenter* to make more of the changes needed by renaming -- thanks to those that have found it and let me know

For Each ctl In .Controls If ctl.ControlType <> acLabel Then sControlSource = Nz(Get_Property_relinker("controlsource", ctl), "") If Len(sControlSource) > 0 Then If Left(sControlSource, 1) <> "=" Then If ctl.Name <> sControlSource Then ctl.Name = sControlSource iCountName = iCountName + 1 End If sLabelName = sControlSource & "_Label" 'associated sLabelName2 = "Label_" & sControlSource 'unassociated Else sLabelName = ctl.Name & "_Label" sLabelName2 = "Label_" & ctl.Name 'unassociated sControlSource = ctl.Name End If If ctl.Controls.Count > 0 Then With ctl.Controls(0) If .ControlType = acLabel Then If .Name <> sLabelName Then .Name = sLabelName iCountLabel = iCountLabel + 1 End If End If End With Else 'no associated label 'look for a label whose caption is the control source For Each ctl2 In .Controls If ctl2.ControlType = acLabel Then If ctl2.Caption = sControlSource Then If ctl2.Name <> sLabelName2 Then ctl2.Name = sLabelName2 iCountLabel = iCountLabel + 1 End If End If End If Next ctl2 End If End If 'Len(sControlSource) > 0 End If 'not a label Next ctl End With

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot delete your posts in this forumYou cannot edit your posts in this forumYou cannot create polls in this forumYou cannot vote in polls in this forum