|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Password form to unwanted Print ScreenI 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 -- Show quoteHide quoteDoug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "DBru" <D***@discussions.microsoft.com> wrote in message news:CDE46628-E304-4EC7-B301-46D5D178F55F@microsoft.com... >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 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 Show quoteHide quote "DBru" wrote: > 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 |
|||||||||||||||||||||||