Okay, I'm not sure why I'm having troubles with this, but I'll blame it on it being Friday 
I'm attempting to pass the name of a control as a string to a subroutine elsewhere in the module. Unfortunately, I'm getting an "Object variable or With block variable not set" message when I try to run the code. I can't seem to track down why I'm getting the error. The sub's code is here:
Any thoughts? Thanks!
I'm attempting to pass the name of a control as a string to a subroutine elsewhere in the module. Unfortunately, I'm getting an "Object variable or With block variable not set" message when I try to run the code. I can't seem to track down why I'm getting the error. The sub's code is here:
Code:
Sub sub_ShowBalance(strControl As String)
Dim ctlLabel As Control, ctlBalance As Control
ctlBalance = Me(strControl)
ctlLabel = Me(strControl & "_Label")
With ctlBalance
If .Value & "" = "" Then
.Visible = False
ctlLabel.Visible = False
Else
.Visible = True
ctlLabel.Visible = True
End If
End With
End Sub
Any thoughts? Thanks!