Print Page | Close Window

UserSeesOnlyHisRecords.mdb (beginner)

Printed From: Roger's Access Library
Category: Roger's Access Library
Forum Name: Roger's Download Samples
Forum Description: A compendium of Microsoft Access 97 and 2000+ routines, each separated into its own sample database.
URL: www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=220
Printed Date: 28 May 2020 at 11:57am
Software Version: Web Wiz Forums 12.03 - http://www.webwizforums.com


Topic: UserSeesOnlyHisRecords.mdb (beginner)
Posted By: Roger Carlson
Subject: UserSeesOnlyHisRecords.mdb (beginner)
Date Posted: 15 Jul 2008 at 10:43pm
 
Please consider donating $1 per sample downloaded, http://www.rogersaccesslibrary.com/whydonations.htm - find out why here .
 
UserSeesOnlyHisRecords.mdb
 
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.

Download
Access 97 (18 KB):
http://www.rogersaccesslibrary.com/forum/uploads/5/UserSeesOnlyHisRecords97.zip - UserSeesOnlyHisRecords97.zip
Access 2000 (31 KB):  http://www.rogersaccesslibrary.com/forum/uploads/5/UserSeesOnlyHisRecords2k.zip - UserSeesOnlyHisRecords2k.zip

-------------
Consider donating $1 per sample downloaded, http://www.rogersaccesslibrary.com/whydonations.htm" rel="nofollow - find out why here .<



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.03 - http://www.webwizforums.com
Copyright ©2001-2019 Web Wiz Ltd. - https://www.webwiz.net