Password form to unwanted Print Screen

  • Thread starter Thread starter DBru
  • Start date Start date
D

DBru

I have password protected some reports on my database. The ones that
generate off of a form work perfectly. If I have the password page go
straight into a report after entering the password a screen that says
"Printing" freezes on my screen and won't allow me to input the information
to generate the report. My code is shown below for the button off of the
password form. I can't figure it out.

Private Sub Command6_Click()
password.SetFocus
If password = "****" Then
MsgBox "Access Granted", vbInformation, "Reporting System"
DoCmd.Close
DoCmd.OpenReport "Report by Day"
Else
MsgBox "Please re-enter your Username and Password."
End If
End Sub
 
Try renaming the text box. Password is a reserved word, and you should never
use reserved words for your own purposes.

For a comprehensive list of names to avoid (as well as a link to a free
utility to check your application for compliance), check what Allen Browne
has at http://www.allenbrowne.com/AppIssueBadWord.html
 
Can you explain to me how you setup your password protection for reports in
your database. I need this for a few of the reports in my db. I get the code
for the button, but how are you prompting your user to input the password?
Thanks
Jacqueline
 
Back
Top