You CAN do this with Access 2003.
The standard way is to set up security for the entire database. This would
require users to log in when they open your app and allow you to assign
rights to every object in the db. There's a lot to this and the best way to
start ias with the User-level Security Wizard. This method is best if you
want each user to have their own user name and password.
If you don't want to set up security but just want to prompt the user for
that single button, it's still possible, but you'll probably just have a
single generic password. This method is far less secure for obvious reasons.
If you want to do it this way, put an input box in code and compare it to a
fixed password.
Private Sub cmdOpenRpt_Click()
If Inputbox("Enter the password","Enter Password") = "thepassword" Then
DoCmd.OpenReport "blah-de-blah"
Else
MsgBox "Incorrect password", vbOkOnly, "Beat It"
End If
End Sub
If you do it this way (which, as I said isn't very secure), don't forget to
password protect the VBA code module so prying eyes can't get at your code
and see your highly cryptic password.
Barry