I am trying to make a function that when I pass the control it will resize the control according to the length of the data in the given text box. I am trying to do this in a report only. Anyone know why I am getting this error?
Run-time error '424':
Object required
Resize (Me.txtLocationTest)
Function Resize(ctl As Control)
Dim tlength As Long
test = Me.TextWidth(ctl)
Me.ctl.Width = test
End Function