Mike Smith
Registered User.
- Local time
- Today, 14:20
- Joined
- Sep 22, 2000
- Messages
- 20
I wrote the following code:
If FunctionName() = "ClarkL" Or "SmithM" Or "ThomasS" Then
Me.cmdEdit.Visible = True
End If
and get a Run-Time Error 13 Type Mismatch. Not sure what the error is indicating, so I rewrote the code:
If FunctionName() = "ClarkL" Then
Me.cmdEdit.Visible = True
ElseIf FunctionName() = "SmithM" Then
Me.cmdEdit.Visible = True
ElseIf FunctionName() = "ThomasS" Then
Me.cmdEdit.Visible = True
End If
which works fine. Is there a way to make the "Or" portion work and make the code smaller...or a better way alltogether?
Mike
If FunctionName() = "ClarkL" Or "SmithM" Or "ThomasS" Then
Me.cmdEdit.Visible = True
End If
and get a Run-Time Error 13 Type Mismatch. Not sure what the error is indicating, so I rewrote the code:
If FunctionName() = "ClarkL" Then
Me.cmdEdit.Visible = True
ElseIf FunctionName() = "SmithM" Then
Me.cmdEdit.Visible = True
ElseIf FunctionName() = "ThomasS" Then
Me.cmdEdit.Visible = True
End If
which works fine. Is there a way to make the "Or" portion work and make the code smaller...or a better way alltogether?
Mike