T
Tom
Hi
Please keep your answers simple as I am cribbing code from ng's whilst
trying to learn VBA.
I have a 'client' database application that requires the user to log in and
provide a password. This is achieved using a start-up form that looks up the
userid and password in a table, and if OK, passes the user on to a form
(frmENTRY). So far, so good.
I want to be able to store the userid as a global variable so that it can be
used by any other forms at a later date, and I cannot get it to work.
So far, I have created a module called 'Global' with the following code
===================
Option Compare Database
Option Explicit
'GLOBAL DECLARATIONS, CONSTANTS AND VARIABLES
Global User_ID As String
==================
I want to be able, for example, to open form frmENTRY and display a textbox
called [USER_LOGGED_IN] that, on opening the form, displays the content of
the global variable 'User_ID'.
Can someone tell me, in the simplest of terms, what code I need to put
behind the 'On Open' control of frmENTRY ?
Many thanks - I have struggling with this for a couple of days and am
getting nowhere.
Regards
Tom
Please keep your answers simple as I am cribbing code from ng's whilst
trying to learn VBA.
I have a 'client' database application that requires the user to log in and
provide a password. This is achieved using a start-up form that looks up the
userid and password in a table, and if OK, passes the user on to a form
(frmENTRY). So far, so good.
I want to be able to store the userid as a global variable so that it can be
used by any other forms at a later date, and I cannot get it to work.
So far, I have created a module called 'Global' with the following code
===================
Option Compare Database
Option Explicit
'GLOBAL DECLARATIONS, CONSTANTS AND VARIABLES
Global User_ID As String
==================
I want to be able, for example, to open form frmENTRY and display a textbox
called [USER_LOGGED_IN] that, on opening the form, displays the content of
the global variable 'User_ID'.
Can someone tell me, in the simplest of terms, what code I need to put
behind the 'On Open' control of frmENTRY ?
Many thanks - I have struggling with this for a couple of days and am
getting nowhere.
Regards
Tom