Quote:
quote:Originally posted by lanctotd
Is there anyplace I can get info on how create a global variable
|
Using Access help should do it for you, but just in case Microsoft's help is cryptic and confusing (which it tends to be), basically: Open a new module. On the top just after you see "Option Compare Database" declare your global variable, e.g.
Code:
Public gstrLoggedUser As String
Then in your logging in form, you set gstrLoggedUser = Me.txtLoggedUser or whoever was in that text box. To make a global
constant variable, you do this:
Code:
Public Const vbGray As Long = 8421504
I use the above constant a lot because there is no vbGray for text color in Access unless you use the RGB function.
Quote:
|
quote:and on how to close forms when another is opened?
|
Use the DoCmd.Close method, e.g.
Code:
DoCmd.Close acForm, "Order Review", acSaveYes
Access help is pretty good for this one.
Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division