I'm currently working on a Security check for my access database but am having a problem.
I have a function that returns the Users Name from the api dll, which is working.
I also have a Security table in my database that holds logon ids and security levels.
Basically, what I want is:
User presses button to open a certain form
Security check is made
If user doesnt have the level the form doesnt open
If user has access then open form.
The code I had writen was:
But it's returning an error. I was looking to have it check to see if any rows are returned, and if so, what security level the row had.
I have a function that returns the Users Name from the api dll, which is working.
I also have a Security table in my database that holds logon ids and security levels.
Basically, what I want is:
User presses button to open a certain form
Security check is made
If user doesnt have the level the form doesnt open
If user has access then open form.
The code I had writen was:
Code:
Dim sSQL As String
Dim rs As ADODB.Recordset
sSQL = "SELECT [Security].[Level] FROM Security WHERE (([Security].[UserID])=fncUserName())"
rs.Open sSQL
But it's returning an error. I was looking to have it check to see if any rows are returned, and if so, what security level the row had.