If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Security question
I have a simple database with many fields that have an 'On not in
list' command. The current code asks for a password to continue by means of an Inputbox. This works fine. Unfortunately, the password information can be seen by everybody (it is not masked). Is it possible to open a new password form and pass the password information somehow to this 'on not in list event'? If the password is correct, the code should continue, if not an warning. The current code looks like this: pw = InputBox("Enter password to continue") If pw = "1234" Then Set db = CurrentDb Set rs = db.OpenRecordset(strTblName, dbOpenDynaset) On Error Resume Next rs.AddNew rs!TEST = NewData rs.Update |
#2
|
|||
|
|||
Security question
On Wed, 19 May 2010 06:45:04 -0700 (PDT), Ixtreme
wrote: Yes you can. Here are a few tips: * Open that new form using WindowMode=acDialog, so it is modal just like InputBox is. * When user clicks OK or Cancel in the new form, run "Me.Visible=False". This makes the form "fall out of the modal loop" so the next line after DoCmd.Openform runs. In that line you can inspect the password form to determine what password was entered, and whether user clicked OK or Cancel. Finally you close that form (DoCmd.Close "myPasswordForm") * You're not handling Cancel yet in your code, but it's important. -Tom. Microsoft Access MVP I have a simple database with many fields that have an 'On not in list' command. The current code asks for a password to continue by means of an Inputbox. This works fine. Unfortunately, the password information can be seen by everybody (it is not masked). Is it possible to open a new password form and pass the password information somehow to this 'on not in list event'? If the password is correct, the code should continue, if not an warning. The current code looks like this: pw = InputBox("Enter password to continue") If pw = "1234" Then Set db = CurrentDb Set rs = db.OpenRecordset(strTblName, dbOpenDynaset) On Error Resume Next rs.AddNew rs!TEST = NewData rs.Update |
#3
|
|||
|
|||
Security question
The way to do this is to open a custom form in dialog mode.
Set the Input mask for the control for entering the password to Password Then when the user presses the close button on the form, set the form's visible property to NO (don't close it). Docmd.OpenForm "frmGetPassword",,,,,acDialog If Forms!frmGetPassword!PasswordTextBox = "1234" THEN DoCmd.Close acForm, "frmGetPassword" 'Close the password form Set db = CurrentDb Set rs = db.OpenRecordset(strTblName, dbOpenDynaset) On Error Resume Next rs.AddNew rs!TEST = NewData rs.Update ELSE DoCmd.Close acForm, "frmGetPassword" 'Close the password form End if John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Ixtreme wrote: I have a simple database with many fields that have an 'On not in list' command. The current code asks for a password to continue by means of an Inputbox. This works fine. Unfortunately, the password information can be seen by everybody (it is not masked). Is it possible to open a new password form and pass the password information somehow to this 'on not in list event'? If the password is correct, the code should continue, if not an warning. The current code looks like this: pw = InputBox("Enter password to continue") If pw = "1234" Then Set db = CurrentDb Set rs = db.OpenRecordset(strTblName, dbOpenDynaset) On Error Resume Next rs.AddNew rs!TEST = NewData rs.Update |
#4
|
|||
|
|||
Security question
On 19 mei, 16:25, John Spencer wrote:
The way to do this is to open a custom form in dialog mode. Set the Input mask for the control for entering the password to * * Password Then when the user presses the close button on the form, set the form's visible property to NO (don't close it). Docmd.OpenForm "frmGetPassword",,,,,acDialog If Forms!frmGetPassword!PasswordTextBox = "1234" THEN * * DoCmd.Close acForm, "frmGetPassword" 'Close the password form * * Set db = CurrentDb * * Set rs = db.OpenRecordset(strTblName, dbOpenDynaset) * * On Error Resume Next * * * *rs.AddNew * * * *rs!TEST = NewData * * * *rs.Update ELSE * * DoCmd.Close acForm, "frmGetPassword" 'Close the password form End if John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Ixtreme wrote: I have a simple database with many fields that have an 'On not in list' command. The current code asks for a password to continue by means of an Inputbox. This works fine. Unfortunately, the password information can be seen by everybody (it is not masked). Is it possible to open a new password form and pass the password information somehow to this 'on not in list event'? If the password is correct, the code should continue, if not an warning. The current code looks like this: pw = InputBox("Enter password to continue") If pw = "1234" Then * * * * Set db = CurrentDb * * * * Set rs = db.OpenRecordset(strTblName, dbOpenDynaset) * * * * On Error Resume Next * * * * * * rs.AddNew * * * * * * rs!TEST = NewData * * * * * * rs.Update- Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven - I tried this but get an error 2450: MS Access cant find the form 'frmGetPassword' referred to in a Macro or Expression etc. I created the form and it shows on the right time. After I click the close button this warning is being displayed. Why? |
#5
|
|||
|
|||
Security question
Because you closed the form frmGetPassword. Don't close it. Use a button on
the form to set the form's visible property to false to hide the form. Me.Visible = False John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Ixtreme wrote: On 19 mei, 16:25, John Spencer wrote: The way to do this is to open a custom form in dialog mode. Set the Input mask for the control for entering the password to Password Then when the user presses the close button on the form, set the form's visible property to NO (don't close it). Docmd.OpenForm "frmGetPassword",,,,,acDialog If Forms!frmGetPassword!PasswordTextBox = "1234" THEN DoCmd.Close acForm, "frmGetPassword" 'Close the password form Set db = CurrentDb Set rs = db.OpenRecordset(strTblName, dbOpenDynaset) On Error Resume Next rs.AddNew rs!TEST = NewData rs.Update ELSE DoCmd.Close acForm, "frmGetPassword" 'Close the password form End if John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Ixtreme wrote: I have a simple database with many fields that have an 'On not in list' command. The current code asks for a password to continue by means of an Inputbox. This works fine. Unfortunately, the password information can be seen by everybody (it is not masked). Is it possible to open a new password form and pass the password information somehow to this 'on not in list event'? If the password is correct, the code should continue, if not an warning. The current code looks like this: pw = InputBox("Enter password to continue") If pw = "1234" Then Set db = CurrentDb Set rs = db.OpenRecordset(strTblName, dbOpenDynaset) On Error Resume Next rs.AddNew rs!TEST = NewData rs.Update- Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven - I tried this but get an error 2450: MS Access cant find the form 'frmGetPassword' referred to in a Macro or Expression etc. I created the form and it shows on the right time. After I click the close button this warning is being displayed. Why? |
#6
|
|||
|
|||
Security question
On 19 mei, 22:20, John Spencer wrote:
Because you closed the form frmGetPassword. *Don't close it. *Use a button on the form to set the form's visible property to false to hide the form. * *Me.Visible = False John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Ixtreme wrote: On 19 mei, 16:25, John Spencer wrote: The way to do this is to open a custom form in dialog mode. Set the Input mask for the control for entering the password to * * Password Then when the user presses the close button on the form, set the form's visible property to NO (don't close it). Docmd.OpenForm "frmGetPassword",,,,,acDialog If Forms!frmGetPassword!PasswordTextBox = "1234" THEN * * DoCmd.Close acForm, "frmGetPassword" 'Close the password form * * Set db = CurrentDb * * Set rs = db.OpenRecordset(strTblName, dbOpenDynaset) * * On Error Resume Next * * * *rs.AddNew * * * *rs!TEST = NewData * * * *rs.Update ELSE * * DoCmd.Close acForm, "frmGetPassword" 'Close the password form End if John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Ixtreme wrote: I have a simple database with many fields that have an 'On not in list' command. The current code asks for a password to continue by means of an Inputbox. This works fine. Unfortunately, the password information can be seen by everybody (it is not masked). Is it possible to open a new password form and pass the password information somehow to this 'on not in list event'? If the password is correct, the code should continue, if not an warning. The current code looks like this: pw = InputBox("Enter password to continue") If pw = "1234" Then * * * * Set db = CurrentDb * * * * Set rs = db.OpenRecordset(strTblName, dbOpenDynaset) * * * * On Error Resume Next * * * * * * rs.AddNew * * * * * * rs!TEST = NewData * * * * * * rs.Update- Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven - I tried this but get an error 2450: MS Access cant find the form 'frmGetPassword' referred to in a Macro or Expression etc. I created the form and it shows on the right time. After I click the close button this warning is being displayed. Why?- Tekst uit oorspronkelijk bericht niet weergeven - - Tekst uit oorspronkelijk bericht weergeven - John, Thank you so much! Kind regards, Mark |
Thread Tools | |
Display Modes | |
|
|