ok

G

Guest

Private Sub Form_Timer()
If Me.UserName = "Admin" Or “Eldon†Or “Soniaâ€Then
Me.Workgroup = "Administrator"
End If
End Sub

I need some assistance with the above code. I have 3 users “Adminâ€, “Eldonâ€
and “Soniaâ€
Basically I want to accomplish this: If the [username] field has either of
the 3 users then the [workgroup] field should have “Administrator†in it.

But its giving me an error. I am just getting into VB so if its so simple
please don’t laugh.

When I use this code………
Private Sub Form_Timer()
If Me.UserName = "Admin" Then
Me.Workgroup = "Administrator"
End If
End Sub
………. And I enter Admin in the username field it works but upon adding in
the “Ors†and the other 2 names I get the error.

Thanks
 
G

Guest

If Me.UserName = "Admin" Or Me.UserName = “Eldon†Or Me.UserName = “Sonia†Then

There may be a nicer way, but you current code is not performinf the check
to Username for the others.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top