Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assigning a password to ComboBox 2

Status
Not open for further replies.

TheunsGoosen

Technical User
Jan 17, 2007
36
GB
Access beginner!

Good day, i have the follwing problem.

In a form i have a ComboBox that allows you to type a numeric value in it. The moment you exit the box the value gets updated in a table...everything works perfectly

What i would like to do is to assign a password to the box so that the moment you try to change the manual value it will ask for a password allowing you to resume entering the vallue or not.

Regards
Theuns
 
You can add code for an InputBox to the Before Update event of the combobox. This method is by no means secure but it is easy to do.

I think you will find that your users will get irritated if they are constantly asked for a password.

You will find many posts on getting passwords in these fora.
 
Thanks Remou,

But this specific information only gets updated twice a year...so a password is needed

How do i go about getting this simple VBA code Msgbox request?

Theuns
 
Here is a thread that shows code for both Inputbox and a small form:
Using windows permissions on a form
thread702-940122

Search (above) will often return a variety of posts, once you have the keywords.
 
I seached a few threads and the only thing i could find is assigning a password to from...can you help me with the VBA code so that when i enter a combobox on the form the code displays a msgbox asking for a passwoord.

Theuns
 
Did you look at the thread I linked (thread702-940122)?
 
You can do it like
Code:
Private Sub Combo2_Enter()
    PWD
End Sub
'==============================
Sub PWD()
    Dim strInput As String, strMsg As String

    strMsg = "Enter Password."
    strInput = InputBox(prompt:=strMsg, _
            Title:="Password")
    If strInput = "YourPassword" Then
        Me.Combo2.Locked = False
        Me.Combo2.SetFocus
    Else
        Me.Combo2.Locked = True
        Me.Text0.SetFocus
    End If
End Sub
The problem is input box doesn't take asteric password.
You could open a small form instead

________________________________________________________
Zameer Abdulla
Help to find Missing people
Sharp acids corrode their own containers.
 
Thanks for the help Remou, the link i will defenity use in the future but currently as beginner the code is above me...i needed xactly the code ZmrAbdulla provided me with, i just replaced his combobox name with mine and it work perferctly..

Thanks for the help
Theuns
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top