Im trying to let users open specific forms. Like the admin can open all and got usertype "1" and the operator got usertype "4" and can only open the orders. Now my idea was to lookup the username of the PC like:
This gives for me the output in textbox TekstLogin : Car. Now i got a table with username and usertype and want to lookup the usertype based on Tekstlogin so i can put if statements on formbuttons (if usertype = 2 ; open ; do not open).Code:Me.TekstLogin = Environ("USERNAME")
The problem i got is the dlookup. im using this code:
This gives an error on the dlookup line. Any idea how i can do this and what im doing wrong?Code:Private Sub Form_Open(Cancel As Integer) Me.TekstLogin = Environ("USERNAME") Tekst454 = DLookup("[UserType]", "tblUser", "[Username]=" & [TekstLogin]) End Sub