My Assistant
![]() ![]() |
|
|
Jul 31 2006, 10:53 AM
Post
#1
|
|
|
UtterAccess Veteran Posts: 461 From: Indiana |
Is there a way to add the password input mask (******) to an input box?
I know that I could just create a custom form...just thought I'd see if anybody knew if this is possible. |
|
|
|
Jul 31 2006, 11:05 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 31,413 From: NC, USA |
Hi,
yes there is...check this sample! But creating a custom form is much easier and looks nicer. HTH Good luck |
|
|
|
Jul 31 2006, 11:17 AM
Post
#3
|
|
|
UtterAccess Veteran Posts: 461 From: Indiana |
I was sort of expecting that. Thanks for the information. Custom forms all around!
|
|
|
|
Jul 31 2006, 11:20 AM
Post
#4
|
|
|
UtterAccess VIP Posts: 31,413 From: NC, USA |
You're welcome.
Good luck on future projects! |
|
|
|
Aug 9 2006, 02:18 PM
Post
#5
|
|
|
New Member Posts: 2 |
Do you have an easy solution for access 97??? I'm stuck supporting & making mods to an old system. The problem I have is during a sub routine, a inputbox was used to get the user password. Problem is that it shows text typed. I tried to open a custom form, but not sure how to stop the code and wait for the user to enter the password, click enter. I planed to hide the form once enter is clicked and then refer to the data on the hidden form, but the code continues from the DoCmd.OpenForm and is already looking for the data from the form which just opened. Any ideas how to modify this without total rewrite?
OLD CODE IS: Private Sub TSFA_Click() Dim PassW As String Dim user As String Dim db As Database Dim rec As Recordset Dim counter Dim x As Integer Process_Final_Approval.SetFocus PassW = InputBox("Please enter your Password.") 'setting variables Set db = CurrentDb() Set rec = db.OpenRecordset("People") rec.MoveLast rec.MoveFirst counter = rec.RecordCount x = 0 'matching password to employee name Do Until x = counter If rec("Password") = PassW Then user = rec("Name") Technical_Final_Approval.SetFocus rec.Edit Technical_Final_Approval = user rec.Update Exit Sub End If x = x + 1 rec.MoveNext Loop 'what happens if password is not valid MsgBox " Your Password was not recognized." & vbCr & vbCr & " Access Denied!", , "Invalid Password" TSFA.SetFocus TSFA.Value = 0 End Sub |
|
|
|
Aug 9 2006, 02:38 PM
Post
#6
|
|
|
UtterAccess VIP Posts: 31,413 From: NC, USA |
Hi,
why not just split up the code? Open your form with: DoCmd.OpenForm "YourPasswordForm" Then on the on click event of a button on this form use: Dim PassW As String Dim user As String Dim db As Database Dim rec As Recordset Dim counter Dim x As Integer Me.Visible = False PassW = Me.YourPasswordControl 'setting variables Set db = CurrentDb() Set rec = db.OpenRecordset("People") rec.MoveLast rec.MoveFirst counter = rec.RecordCount x = 0 'matching password to employee name Do Until x = counter If rec("Password") = PassW Then user = rec("Name") Technical_Final_Approval.SetFocus rec.Edit Technical_Final_Approval = user rec.Update Exit Sub End If x = x + 1 rec.MoveNext Loop 'what happens if password is not valid MsgBox " Your Password was not recognized." & vbCr & vbCr & " Access Denied!", , "Invalid Password" HTH Good luck |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 18th May 2013 - 10:26 AM |