Password form not blank by default

arage

Registered User.
Local time
Today, 18:57
Joined
Dec 30, 2000
Messages
537
Password form not blank by default
Hi,
I created a form to receive passwords but as I created the form fields as bound to a password file whenever I open the form I see a bunch of ****’s in the required fields rather than a blank. I tried putting NULL in the default value property but that isn’t working either. What shud I do?
Also cud someone briefly outline vb code that wud show how I’d access entered values in above form so that I cud open other forms based on the user trying to get in?
Thanks
 
OK, Let's say that you have a form called fLogin, and you have a txtUserId & txtPassword field, and some button that the user clicks when they have everthing filled in. You would put the following stuff in the "On click" event for the button. You will additional code that need to be here, too, and I haven't shown the "Dim" for anything:

'Make sure a user ID has been entered
If IsNull(Me![txtUserID]) Then
MsgBox "You must enter an ID number.", vbExclamation, "USER ID REQUIRED"
Me.txtUserID.SetFocus
Exit Sub
End If

'Make sure a password has been entered
If IsNull(Me![txtPassword]) Then
MsgBox "You must enter a password.", vbExclamation, "PASSWORD REQUIRED"
Me.txtPassword.SetFocus
Exit Sub
End If

' Do your security checking here
' Probably reading stuff from a table?
.
.
.

'Store the security code to a global variable
strSecurityCode = 'whatever you need to save


'Check to see if they are an authorized user, and exit program if not
If strSecurityCode = "N" Then 'or whatever
strMsgA = "You have not been authorized to use this program."
strMsgB = "Please see your supervisor about obtaining proper authorization."
MsgBox strMsgA & Chr(10) & Chr(10) & strMsgB, 0, "SECURITY CHECK"
Exit Sub
End If

'Good users drop through to here
'For this example, everyone goes to the menu
'Open the Menu screen
strDocName = "fMenu"
DoCmd.OpenForm strDocName

'Close this form
DoCmd.Close acForm, "fLogin"

And if you have read this far, you cud, wud, shud run a spellchecker on your posts.
 
thanks for some of the code Chris, but it doesn't answer my question as to when opening the form the bound controls shud display as blank, not with any *** inside them as they do now.

Btw, cud, wud, & shud are bad habits i
picked up from an icq chatter. it helps
lower the amount of typing tho, try it
sometime
smile.gif
 
just to make my form question more simple:

my input mask on my text box is PASSWORD

my text box is bound to a table containing
password info.

my text box shows *** whenever the form
is opened. it should not do this it should
show blanks & not contain ANY value that
may exist in the table the control is bound
to.

how can i make my bound control default to
blank? i've tried ISNULL and "" in the default property but those dont work, so
what do i do?
 
never mind, i seem to have come to the earth shattering revelation that my text box controls shudn't have been bound in the first place

DOH!!!
 

Users who are viewing this thread

Back
Top Bottom