As Micron mentions, code has to be in a standard module which opens the form in design view. Have the form call this PUBLIC code
Code:
Option Compare Database
Option Explicit
Public Sub reLabel(fName As String)
Dim C As Control
Dim L As Integer
Dim K As Integer
Dim M As Integer
Dim temp As String
Dim bolStart As Boolean
bolStart = False
L = 11
K = L
M = 7
DoCmd.OpenForm fName, acViewDesign, , , acNormal
For Each C In Screen.ActiveForm.Section(acDetail).Controls
If TypeName(C) = "Label" Then
If (C.Name = "label165") Or (bolStart = True) Then
bolStart = True
C.Name = "lblDrug" & K '<<<<<<<<<<<<<<<<< NO NO NO says access
Debug.Print C.Name
K = K + 1
M = M - 1
If M = 0 Then
M = 7
L = L + 10
K = L
End If
End If
End If
Next C
DoCmd.Close acForm, fName, acSaveYes
DoCmd.OpenForm fName
End Sub