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

Passwording Certain Forms

Status
Not open for further replies.

Silveressence

Programmer
Jan 10, 2002
1
0
0
CA
Hi,

I would like to know if there was anyway to password certain forms in Microsoft Access. My friend and I are creating a database for the school music program and the teachers would like us to allow student access to certain forms only. Is there VB coding that would prompt the user for a password in certain forms?

Thanks in advance,
Balinda P.
 
You probably don't actually want to set up passwords for each of the individual forms. Instead, use Access workgroup security to have users log in when the database is open.

Put the names of students in a "Students" group (or just create a general "Student" account that all students can use) and the names of teachers in "Teachers" group. Then you would just set the permissions on the forms so that only teacher could open them (or rather, so that students can not).
 
You can use an input box in the OnOpen event of your form to collect a password. Then test the password to see if it's correct. If it isn't then close the form. This isn't a perfect solution which would be as jpa suggests, implemention of user level security, but either approach has problems. Specifically in the technique you're contemplating, a decent password.

I use the input box technique to password protect certain fields that I don't want all users to be able to modify. Then I use a password that's generic such as six digits with the middle two matching the current month. Any other combination fails. It's pretty low level security, but adquate for the most part.

Uncle Jack
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top