I am working on a way to hold a variable throughout the life of an application. I created a module like this:
The idea is to use a login form with a user name and password to get the access level of the person using the database. I am using this code temporarily to make sure I am getting the right results.
With this code I know that I am getting the right criteria back.
I understand that the variables are held in the memory of each computer accessing it and will be killed when the app on each computer when the app is closed. Is there a problem with having multiple computers connected to the database, all using the same public variables at the same time? I mean they will be the same public calls but using unique variables.
Code:
Option Compare Database
Option Explicit
Public strUname As String
Public strPword As String
Public intAccess As Integer
The idea is to use a login form with a user name and password to get the access level of the person using the database. I am using this code temporarily to make sure I am getting the right results.
Code:
If Not IsNull(DLookup("Username", "tblSupers", "([UserName]= '" _
& Me!txtUname & "') and ([Password]= '" & Me!txtPword & "')")) Then
MsgBox ("Found a match")
Else
MsgBox ("No Match was found")
Exit Sub
End If
strUname = Me.txtUname
strPword = Me.txtPword
intAccess = DLookup("LocCode", "tblSupers", "[UserName]= '" & strUname & "'")
MsgBox (strUname & strPword & intAccess)
With this code I know that I am getting the right criteria back.
I understand that the variables are held in the memory of each computer accessing it and will be killed when the app on each computer when the app is closed. Is there a problem with having multiple computers connected to the database, all using the same public variables at the same time? I mean they will be the same public calls but using unique variables.