Tupacmoche
Registered User.
- Local time
 - Today, 01:41
 
- Joined
 - Apr 28, 2008
 
- Messages
 - 291
 
Hi Form Masters,
I'm using the following code to disable a button on a form. Only the user in the code can use the button. I can foresee that this can become a disaster. Any suggestions on how to improve it?
Private Sub Form_Load()
If GetCurrUser = "Robert Semo" Or GetCurrUser = "Pass Rey" Or GetCurrUser = "Elizabeth Plla" Or _
GetCurrUser = "Andrew Moades" Or GetCurrUser = "Travis Simms" Or GetCurrUser = "Erica Glee" Or GetCurrUser = "Mee Lay" Or GetCurrUser = "Chris Reeby" Then
Me.btnDEC.Enabled = True
Else
Me.btnDEC.Enabled = False
End If
End Sub
 I'm using the following code to disable a button on a form. Only the user in the code can use the button. I can foresee that this can become a disaster. Any suggestions on how to improve it?
Private Sub Form_Load()
If GetCurrUser = "Robert Semo" Or GetCurrUser = "Pass Rey" Or GetCurrUser = "Elizabeth Plla" Or _
GetCurrUser = "Andrew Moades" Or GetCurrUser = "Travis Simms" Or GetCurrUser = "Erica Glee" Or GetCurrUser = "Mee Lay" Or GetCurrUser = "Chris Reeby" Then
Me.btnDEC.Enabled = True
Else
Me.btnDEC.Enabled = False
End If
End Sub