One last question I came up with...I don't want the user to have to sign in upon the load of each form. I only want them to sign in ONCE when frmMainMenu opens. I need to tell each form what the value of mUser is. would I do this with the SET command like you had mentioned? what would the code be and where would I declare this variable in each form?
thank you again!...a very slow learner!!
The user signs in just once. That value is available anywhere and doesn't have to be declared again. The value will not change as you open and close forms. For instance you can pass the following SQL statement anywhere in code.
"INSERT INTO tblName (UpdatedByField) VALUES (mUser);"
Or set the value on a textbox using code:
Me.textBoxName = mUSer
The only restriction is that it cannot be referenced directly in a query design. But this can be got around by using a function to return it. The following function should be put in a module.
Function getUser() As String
getUser=mUser
End Function
You still can't reference it directly in the where statement but you can get around this by referencing it in the SELECT as follows:
SELECT IIf([UpdatedByField]=getUser(),[UpdatedByField],Null) As tmpA
FROM tblName
WHERE tmpA Is Not Null;
The only way this value will change is if another user signs in or the database closes.