Hi
I'm new to access and sql server and my question is this:
I have a form that acts as a login dialog box. When the user enters the correct details a user id is returned from the database. This helps me identify the users access to other forms in the application. I want to store the returned user id in a global constant variable, or a global variable, so that i can refer to it every time I enter a new form.
So far what I have done is store the returned value in a field on the login dialog box. Then I assign the field to a global variable. Access XP doesn't like this. Is there anyway round this problem. Please help as I cannot move forward with developing my app.
the code so far to store the value to a global variable
module mdGlobalVariables
Public Const conUserid As Integer = forms!formLoginScreen!txtUserID
Error:
Constant expression required.
Thanks in Advance
I'm new to access and sql server and my question is this:
I have a form that acts as a login dialog box. When the user enters the correct details a user id is returned from the database. This helps me identify the users access to other forms in the application. I want to store the returned user id in a global constant variable, or a global variable, so that i can refer to it every time I enter a new form.
So far what I have done is store the returned value in a field on the login dialog box. Then I assign the field to a global variable. Access XP doesn't like this. Is there anyway round this problem. Please help as I cannot move forward with developing my app.
the code so far to store the value to a global variable
module mdGlobalVariables
Public Const conUserid As Integer = forms!formLoginScreen!txtUserID
Error:
Constant expression required.
Thanks in Advance