Trimming problem

G

Guest

I am using a text box for a password (with Input mask as Password).The text
box is trimming the trailing spaces(spaces after the word) but not the
leading spaces(spaces before the word).I don't want the Access to trim the
trailing spaces also.

Suppose my password is wow, when I type " wow" ( with 3 blank spaces
before wow), it is showing as Incorrect password.That is what I want but when
I type "wow " (with 3 blank spaces after wow),Access is trimming the spaces
automatically. It is not showing as Incorrect password. I don't want
this.Rather I want the Access to say Incorrect Password.
 
R

RobMastro via AccessMonster.com

Is there an event in the control (of the Password text box)?
 
G

Guest

yes , RobMastro --

Private Sub txtAttPwd_LostFocus()
If Len(txtAttPwd & vbNullString) > 0 Then
Dim con3 As ADODB.Connection
Dim rs3 As ADODB.Recordset
Dim strsql3 As String
strsql3 = "Select Attpwd from tblSupervisor where Attpwd= '" &
Me.txtAttPwd & "'"
Set con3 = CurrentProject.Connection
Set rs3 = New ADODB.Recordset
rs3.Open strsql3, con3, adOpenKeyset, adLockOptimistic
If rs3.RecordCount > 0 Then
Me.lblAttPwd.Visible = False
Me.cboEmpName.SetFocus
Me.txtAttPwd.Visible = False
cmdAttendanceDate.Visible = True
Image125.Visible = True
cmdChangeAttDate.Visible = False
cmdAttendanceDate.SetFocus ''' NOTE:you can't set focus to
any image
Else
MsgBox ("Password Incorrect.")
Me.txtAttPwd = ""
Me.cboEmpName.SetFocus
Me.txtAttPwd.SetFocus
End If
Set rs3 = Nothing
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top