Hi All,
For my A-Level Computing Project I have created a database that holds details on students in a boarding college and details of where they are at half terms/end of terms etc. For the security of this database i need to lookup the user ID from a table and then give the user specific permissions i.e. students can only see the forms for the holidays and teachers can see the reports of all forms.
I have a module (modGetCurrentUserName) which finds the currently logged on user in the form "forename.surname"
To lookup from the table I have tried this code...
Dim UserName As String
UserName = GetCurrentUserName()
strUser = DLookup("[Role]", "tblStaff", "[UserID] = UserName")
The problem that I am having is that an error is always produced when processing the [criteria] part of the function.
From this function I want to be able to use a select case statement such as
Select Case strUser
Case "SMT"
Call AdminPermissions
Case "Housemaster"
Call HousemasterPermissions
Case "Prefect"
Call PrefectPermissions
Case Else
Call StudentPermissions
End Select
to allocate different buttons and provide the security.
If anyone could help me with the criteria problem it would be very much appreciated...my coursework deadline is soon!!!
Thanks a lot!
James Aubrey
For my A-Level Computing Project I have created a database that holds details on students in a boarding college and details of where they are at half terms/end of terms etc. For the security of this database i need to lookup the user ID from a table and then give the user specific permissions i.e. students can only see the forms for the holidays and teachers can see the reports of all forms.
I have a module (modGetCurrentUserName) which finds the currently logged on user in the form "forename.surname"
To lookup from the table I have tried this code...
Dim UserName As String
UserName = GetCurrentUserName()
strUser = DLookup("[Role]", "tblStaff", "[UserID] = UserName")
The problem that I am having is that an error is always produced when processing the [criteria] part of the function.
From this function I want to be able to use a select case statement such as
Select Case strUser
Case "SMT"
Call AdminPermissions
Case "Housemaster"
Call HousemasterPermissions
Case "Prefect"
Call PrefectPermissions
Case Else
Call StudentPermissions
End Select
to allocate different buttons and provide the security.
If anyone could help me with the criteria problem it would be very much appreciated...my coursework deadline is soon!!!
Thanks a lot!
James Aubrey