Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft Access - Storing Temporary information

Status
Not open for further replies.

Toby3652

Technical User
Joined
Jul 3, 2008
Messages
2
Location
US
I'm putting together a dbase in Access 2007 that has a logon page. I have a table with users' information (logon, password, etc.). I've created a form for users to log in from and added some code to validate it against the users' table to make sure that the password and logon matches.

Here's where I'm stuck. Once the user has logged in, I need to filter all the records they view to only their own records. Any data that they contribute needs to be stamped so that I can see who entered it. So I need to store the user's name/id somewhere in the open file so that I can filter the forms and reports by the 'current user'.

Can anyone tell me the best way to store "temporary information" that can be used to filter reports, queries and forms?
--
Any help is appreciated. And thanks to all you guys and gals who read and
reply to these threads. You're the best!
 
Hi Toby,

Just hide the login form after you verify they are authorized to use the app, instead of closing the form.

Me.visible = False

Then you can always get the login name from the hidden form whenever you need to check and see what it is (like when you want limit the records returned in a form) or when you need to automatically attach the name to a new record they create.

HTH,
T
 
You can store the information in a Public variable in a Standard Module. The information will be available anywhere in the app until the app is closed. The only gotcha is that if an error occurs the variable gets reset. So, you would need to close and reopen the app.
 

Store that in a local table (in case of FE/BE environment). When a user logs on, clear the table and add the record. Even if an error occurs, you still have that value to read in a Public variable in a Standard Module.
 
I use the hidden form method - everything else is looked up from the validated login value on the form.

The other advantage is that the for runs a bunch of stuff on close - since I know it will always be open if the database was in use, it works well.

SeeThru
Synergy Connections Ltd - Telemarketing Services

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top