Hello,
Right now I'm having some performance issues (forms taking 2 or so seconds to check) when trying to check for all control labels in a loop. Currently the code I have is this:
Though this works, I would prefer a more elegant solution that doesn't resort to an error handler if a control doesn't have a label. I think having this in a loop through all controls in a form is the reason why it doesn't update in the snap of a finger. Could somebody please advise me on a quicker/more elegant way to check for the existence of a label?
Thanks.
Right now I'm having some performance issues (forms taking 2 or so seconds to check) when trying to check for all control labels in a loop. Currently the code I have is this:
Code:
Function hasLabel(ByRef ctl As Control) As Boolean
Dim tempstr As String
On Error GoTo err_handler
tempstr = ctl.Controls(0).Name
hasLabel = True
Exit Function
err_handler:
hasLabel = False
Exit Function
End Function
Thanks.
Comment