johndoomed
VBA idiot
- Local time
- Today, 04:34
- Joined
- Nov 4, 2004
- Messages
- 174
Hi all! Since the weather has been shit all summer, I have (finally) started to upgrade from 2000 till 2003. On the whole this seems to go quite well, but there is one problem I can't seem to solve. I've decided to start over again with this script.
The problem is the onload script on my main from (Startup form). I'm using this to identify the user. The form is connected to a table containing the different users (Person_ID).
I get a run-time error (-2147352567), and a message that I cannot "assign a value" (My Access is in norwegian, so the message could sound a bit different ;-)
Anyways.. Hope you guys can help me yet again!
The problem is the onload script on my main from (Startup form). I'm using this to identify the user. The form is connected to a table containing the different users (Person_ID).
I get a run-time error (-2147352567), and a message that I cannot "assign a value" (My Access is in norwegian, so the message could sound a bit different ;-)
PHP:
Private Sub Form_Load()
User = Environ("USERNAME")
Person = Me.[Person_ID]
If User = "jel" Then
Me.[Person_ID] = "1"
Me.Admin.Visible = True
GoTo Ending
ElseIf User = "kro" Then
Me.[Person_ID] = "2"
Me.Admin.Visible = False
GoTo Reguser
Else
MsgBox ("User not not found.")
Me.Admin.Visible = False
GoTo Reguser
End If
Reguser:
Dim i As Integer
For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i
Ending:
End Sub
Anyways.. Hope you guys can help me yet again!