Passing parameters

  • Thread starter Thread starter Kim
  • Start date Start date
K

Kim

I am not using the builtin user level security, I am
taking care of security myself in code, so how do I pass
from one form to another to another which user is logged
in? I used a temporary query to verify name and password,
is there a way to keep the query until the session is
terminated? Or any other suggestions?
 
A simple way, if you are using a form to have the user
enter an ID and/or password.

Instead of closing the login form, hide it with:

Visible = False
if the form is a modal add
Modal = False

Then, whatever form you want to use the ID, add the
following to the form load event:

UserID = Forms!frmUserID!UserID

The left side of the statement (UserID) is the name of
the field on the form you are loading that you want to
RECEIVE the passed value

The right side (Forms!frmUserID!UserID) is the name of
the field on the hidden log-in form that contains the
value you are passing.

If you are not using a form to log-in you can declare a
Public variable and use it in runtime.

Let me know.
 
I tried this, when I ran it, it gave me an error on the
line SignOnForm.Visible = False it said Object Required
 
This may be a good time for a "global" variable. Declare the variable in a
module's General Declarations section as Public so that it will have scope
throughout your application (a module in the modules tab of the database
window, not a module behind a form or report). Once you have the value(s),
place them in these "global" variables.

For more information, search the VBA help file for Scope and Visibility.
 
If the form is the current form try
Me.Visible = False

If the form isn't the current form try
Forms!SignOnForm.Visible = False
 
Nevermind, it worked!!! Thank you thank you thank you!!!
You have no idea how much I love you right now!
 
Back
Top