I am unable to refer to a variable in an IIF statement.
Here is what I have done. I declared the variable in a module.
Public strUnused As String
I set it to True when the form opens.
strUnused = True
After a combo is run it is set to False
strUnused = False
The form uses If/End If code.
Private Sub Combo15_AfterUpdate()
If strUnused = True Then
Command12.Visible = False
Command12.Visible = True
strUnused works perfectly in the above code.
Now, the problem.
I created a Text Box and for Control Source I used an IIF statement.
The Text Box shows an error - #Name?
I put quotes around True.
The Text Box still shows the error - #Name?
I try to remove the square brackets but they keep coming back in.
I would appreciate it if someone can tell me how to refer to this variable in the IIF statement.