Minuet
The best way would be to implement security with Access. Please keep in mind that users, if they know how, can access information directly off the data tables.
Access security will allow you to control access at the form and table level.
Okay, back to the form -- there are a couple of tricks, and they are just tricks, not real security...
The sequence of events for a from are...
Open -> Load -> Resize -> Activate -> Current
Data is not loaded until the current event occurs.
Consequently, at the form level, you can use the On Load event to close the form.
Dim strPass as String
strPass = InputBox("Enter access code: ", "Validation", "****"
if strPass <> HoweverYouGetYourPassword then
DoCmd.Close acForm, YourFromName
end if
Perhaps a neater solution is to open a password form. After the password validation has occurred, then hide the password form - make it invisible, then in the load of the form in question, for the On Load event, check to make sure the password form is still open. If not close the form. (But remember to make the password form visible and close it upon closing the main form in question....
After loading main form from password form, for the On Load event...
if Not IsLoaded("YourPasswordForm"

then
DoCmd.Close acForm, YourFromName
end if
What is wrong with the form control...
- Data can be viewed at the table level
- The form could be opened in edit mode, and code disabled
If it is really important, consider implementing security. (BUT make sure you have backups)
Richard