Password form to unwanted Print Screen

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
 
D

Douglas J. Steele

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
 
J

Jacqueline

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top