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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password Question

Status
Not open for further replies.

siebel2002

Programmer
Oct 8, 2001
102
US
I have a subform with a checkbox that marks it as private.

Once the user inputs his private data, such as his personal contact info, to the subform and subsequently clicked the checkbox, I want this subform to be visible only to this user. If the checkbox is left unchecked, then the subform should be visible to all users.

I am envisioning using password protection of the subform as a way to accomplish this. Could anyone point me in the right direction? Thanks a lot in advance.

fets
 
if using win 2k or later....

you could store / add the users log on ID in a field...then compare that to the system value for any user logged on, via the environ function.
--------------------------
dim current_user as string

current_user=environ$(username)

if subform user_name_field <> current_user then subform.visible=false else subform.visible=true
--------------------------
 
I'm sure there is a FAQ around here for getting user names. If not, let me know & I'll dig out the code for you.
When the user clicks the private checkbox, put some code which writes the username to the record too.
Now change your rowsource of the subform to only those records matching the current username.
This method means that users won't need to log in twice as they will already have logged into windows once and are just using the existing details.
If you don't log into windows, then the basic method can be adapted to use a custom login form.

HTH

Ben ----------------------------------
Ben O'Hara
bo104@westyorkshire.police.uk
----------------------------------
 
Hi Ben:

Thanks for feedback. Yes, let me know where i can get my hand on the code & please suggest how I may pursue the custom login form .. Thanks.
 
LOOK AT ALL YOUR RESPONSES...EH?

(the first response to this thread),I put the syntax there already.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top