Hi all (1 Viewer)

djshrew

Registered User.
Local time
Today, 02:36
Joined
May 29, 2006
Messages
60
First off i would just like to say that this site is great if you troll through all the example and help people have been given on here. it has really helped me to understand a few bits about access, i really had no clue as to the amount of this you can do. One thing however i could't find on here is a feature where i could have a field box that had a button that requires a password to be able to see its content.

So first off is this possible?
and second how do you do it?

Basically i have a box which will contain password for things. i want to create a button that when i click it, it prompts for a password. i enter the password and it reviels the content of the box.


Thnaks in advance.

Shrew
 

rat_b76

Registered User.
Local time
Today, 11:36
Joined
May 20, 2003
Messages
37
Hi Shrew,

By the use of VBA code you could do the following:

1. On click of the button have an Inputbox prompt for the password

2. If the password is correct then alter the Input Mask of the text field from "PASSWORD" to ""

3. If the password is incorrect then do nothing

It all comes down to your level of knowledge of VBA?

rat_b76
 

djshrew

Registered User.
Local time
Today, 02:36
Joined
May 29, 2006
Messages
60
My knowelge of access and VBA is very limited, in the sense that i have only really had a stab at it for 2 days. so by no means am i am expert. i have masked off the box with the passwords in, but whats to stop someone just unmasking the box through design view? or is this where MDE becomes usfull?
 

djshrew

Registered User.
Local time
Today, 02:36
Joined
May 29, 2006
Messages
60
i have found this.....

Code:
Private Sub Unlock_Button_Click()

Dim strInput As String
    Dim strMsg As String
    
    Beep
    strMsg = "This form is used only by the ''Special Form'' people." & vbCrLf & vbLf & "Please key the ''Special Form'' password to allow access."
    strInput = InputBox(Prompt:=strMsg, Title:="Special Password")
    If strInput = "SpecialFormPassword" Then 'password is correct
        DoCmd.OpenForm "EncryptedBox"
        DoCmd.Close acForm, Me.Name
    Else 'password is incorrect
        MsgBox "Incorrect Password!" & vbCrLf & vbLf & "You are not allowed access to the ''Special Form''.", vbCritical, "Invalid Password"
        Exit Sub
    End If
    
End Sub

Is there a way i can mod this to relate to my text box? when i click my button it askes for password, can i make it so when i enter the correct password it chenges the masking form password to normal text and numbers?

Thanks once again.

Shrew
 
Last edited:

ghudson

Registered User.
Local time
Yesterday, 21:36
Joined
Jun 8, 2002
Messages
6,195
You can not use the code (my code :) you found with a text box for that code you posted is for an input box, not a text box. You can not format an input box. Well yes you can but it requires a lot of code and I do not think that you are at that level to be messing with it.

Can you explain in detail exactly what you want and how you want it to work?
 

djshrew

Registered User.
Local time
Today, 02:36
Joined
May 29, 2006
Messages
60
Well this is my database, and you will see the encrypted area. and the button with your code, but i could't figure out how i could use it. to change the encryption mask, altho i did spend a while trying to figure a was out.

Code:
http://www.dsltech.co.uk/Main.zip
 

rat_b76

Registered User.
Local time
Today, 11:36
Joined
May 20, 2003
Messages
37
Shrew,

You are getting closer, on the 'Unlock' button, alter the code for the 'password is correct' statement to something like:

Code:
EncryptedBox.InputMask = ""

You will see this reveals, once the correct password has been entered, the text underlying, you could also create a new button which is hidden that becomes visible once the correct password is entered to re-encrypt the text by setting:

Code:
EncryptedBox.InputMask = "PASSWORD"
 

djshrew

Registered User.
Local time
Today, 02:36
Joined
May 29, 2006
Messages
60
rat_b76 said:
Shrew,

You are getting closer, on the 'Unlock' button, alter the code for the 'password is correct' statement to something like:

Code:
EncryptedBox.InputMask = ""

You will see this reveals, once the correct password has been entered, the text underlying, you could also create a new button which is hidden that becomes visible once the correct password is entered to re-encrypt the text by setting:

Code:
EncryptedBox.InputMask = "PASSWORD"

Your are a star works a treat, thank you so much.
 

Users who are viewing this thread

Top Bottom