By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,830 Members | 682 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,830 IT Pros & Developers. It's quick & easy.

Input Mask and Simple Login Form

P: 15
Is there a way to add an input mask in an input box?
Dec 28 '07 #1
Share this Question
Share on Google+
7 Replies


missinglinq
Expert 2.5K+
P: 3,532
Afraid not! What you can do is create a small popup form that emulates an Input Box. Then you can do all the things any form can do.

Welcome to TheScripts!

Linq ;0)>
Dec 28 '07 #2

P: 15
Afraid not! What you can do is create a small popup form that emulates an Input Box. Then you can do all the things any form can do.

Welcome to TheScripts!

Linq ;0)>


That's what I figured, now comes the next question... I have created a popup form (with the text field input mask set to password) and I have two command buttons on it. One cancels and closes the form and I want the other one to verify that the password is correct, opening the administrator form. I know I need to write the code but can't figure it out. Any ideas? I'm sure it's simple, I'm just new. Thanks!
Dec 28 '07 #3

Minion
Expert 100+
P: 108
That's what I figured, now comes the next question... I have created a popup form (with the text field input mask set to password) and I have two command buttons on it. One cancels and closes the form and I want the other one to verify that the password is correct, opening the administrator form. I know I need to write the code but can't figure it out. Any ideas? I'm sure it's simple, I'm just new. Thanks!
There are several ways to go about this and I'm sure you'll get a couple example in the following posts. However, first we need to know a few things.
1. Is the password stored as variable or in a table?
2. Is the password associated with a particular user?
3. Are you planning on using any more encryption beyond the input mask?
4. Do you want to limit the number of attempts?
Of course there are more, but this should allow for a basic example to be drawn up. I think I have some existing code in a project that will work for this (it's a admin panel of my own) that I will share as soon as I know the parameters of the question.

Keep us up to date.

- Minion -
Dec 28 '07 #4

P: 15
The password is stored in a table and not associated with a certain user. It's just a simple password that will allow me to access the form in order to edit the records. The input mask is just so no one can see what's entered and there is no need to limit the number of attempts. All I'd like is that when the password is entered correctly the command button, when clicked, will verify the password and if it's correct open the form. It sounds simple but I'm clueless when it comes to writing code... i.e. it's not in the VBA for Dummies book! Thanks for any help you can offer.
Dec 30 '07 #5

missinglinq
Expert 2.5K+
P: 3,532
Assuming:

2 buttons, CancelButton and SubmitButton

1 textbox, PasswordTextBox

1 table, PasswordTable

1 field in PasswordTable named AdminPassword (text datatype)

1 form, AdminForm

On your login form:

Expand|Select|Wrap|Line Numbers
  1. Private Sub CancelButton_Click()
  2.   DoCmd.Close
  3. End Sub
  4.  
  5. Private Sub SubmitButton_Click()
  6.  
  7. If DLookup("AdminPassword", "PasswordTable") = Me.PasswordTextBox Then
  8.   DoCmd.Close
  9.   DoCmd.OpenForm "AdminForm"
  10. Else
  11.   MsgBox "Incorrect Password! Try again!"
  12.   PasswordTextBox.SetFocus
  13.   Me.PasswordTextBox = ""
  14. End If
  15.  
  16. End Sub
Linq ;0)>
Dec 30 '07 #6

P: 15
Worked great! Thanks again for all the help. I'm sure it was rather obvious, but a huge help to a beginner!
Dec 31 '07 #7

missinglinq
Expert 2.5K+
P: 3,532
Glad we could help!

Linq ;0)>
Jan 1 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.