thmsjlmnt3953
Registered User.
- Local time
- Today, 22:04
- Joined
- May 20, 2014
- Messages
- 120
Hi,
I have a dlookup which gets the empid on login - i know this works as i fire a msgbox with this, this is stored in a global variable.
i have the following code running on 'form_load' to set securities however its just using the first records and not the ones linked to the specified accont - i have a second messagebox fire just before these dlookups just so i know the global is correct
The EmpIDLogin is 1786 (my own) and i have pasted a copy of the table in question (well a portion)
its only using the first row of checks to provide permissions.
any help would be fantastic
I have a dlookup which gets the empid on login - i know this works as i fire a msgbox with this, this is stored in a global variable.
i have the following code running on 'form_load' to set securities however its just using the first records and not the ones linked to the specified accont - i have a second messagebox fire just before these dlookups just so i know the global is correct
Code:
Private Sub form_load()
DontKick = 0
DoCmd.SetWarnings False
DoCmd.RunSQL "Update tblKickUsers SET KickFlag = 0"
DoCmd.SetWarnings True
DoCmd.Maximize
SetFormIcon Me.hWnd, "w:\backshift database\hsicon.ico"
MsgBox EmpIDLogin
If DLookup("EnterRecords", "tblpermissions", "[empid]" = "'" & EmpIDLogin & "'") = -1 Then
cmdNavEnterRecords.Enabled = True
End If
If DLookup("EnterBackshift", "tblpermissions", "[empid]" = "'" & EmpIDLogin & "'") = -1 Then
cmdRecordsConveyor.Enabled = True
End If
If DLookup("EnterPetfood", "tblpermissions", "[empid]" = "'" & EmpIDLogin & "'") = -1 Then
cmdPetFood.Enabled = True
End If
If DLookup("EnterBCode", "tblpermissions", "[empid]" = "'" & EmpIDLogin & "'") = -1 Then
cmdRecordsBCode.Enabled = True
End If
End Sub[ATTACH]57128._xfImport[/ATTACH]
The EmpIDLogin is 1786 (my own) and i have pasted a copy of the table in question (well a portion)
its only using the first row of checks to provide permissions.
any help would be fantastic