Roger's Access Library Homepage
Forum Home Forum Home > Roger's Access Library > Roger's Download Samples
  New Posts New Posts RSS Feed - UserSeesOnlyHisRecords.mdb (beginner)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Please consider donating $1 per sample downloaded, (find out why here)

UserSeesOnlyHisRecords.mdb (beginner)

 Post Reply Post Reply
Roger Carlson View Drop Down
Microsoft MVP
Microsoft MVP

Joined: 20 Feb 2008
Status: Offline
Points: 261
Post Options Post Options   Thanks (0) Thanks(0)   Quote Roger Carlson Quote  Post ReplyReply Direct Link To This Post Topic: UserSeesOnlyHisRecords.mdb (beginner)
    Posted: 15 Jul 2008 at 10:43pm
Please consider donating $1 per sample downloaded, find out why here.
This sample shows how you can restrict data being displayed to just those records that match the user's network Login ID.

Here's how it works:

The autoexec macro opens then hides the FLogin form. You could even use a splash screen if you want, just HIDE it instead of closing it in the Timer event.

In the OnOpen event of the FLogin form, there is code that populates the textbox with the users login name. It calls the GetCurrentUserName() function in the UserComputer module.

Notice the query returns 0 rows, because you are not in the database. Change one of the records in the table to your name and loginid, and try it again.

You will need to import the module and the FLogin form into your application and change the autoexec macro to include the steps that mine has. You will also need to change all of your queries to reference the textbox on the FLogin form, just like my query does.

Access 97 (18 KB):
Access 2000 (31 KB):
Consider donating $1 per sample downloaded, find out why here.<
Back to Top
Sponsored Links

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.