B
bubbadahut
Please help me to understand what is happening here.
I am trying to convert some code I found on a web site to fit my
application.
I have a table named "tblUsers"
with the fields:
fldUserID - autonumber
fldUser - text
fldPsWd - text
I have a from named "frmLogon"
with a two txt fields named "cmbUser" and "txtPsWd"
the cmbUser field is a combo box which gets its value from the
tblUsers.fldUserID
the txtPsWd is a text box
here is the code triggered by a comand button on frmLogon:
If Me.txtPsWd.Value = DLookup("fldPsWd", "tblUsers", "fldUserID=" &
Me.cmbUser.Value) Then
LoggedUser = Me.cmbUser.Value
My problem is this:
As it stands, the code works just fine. However, what I want to do is
change the combo box "cmbUser" to a text field "txtUser" with the
following code:
If Me.txtPsWd.Value = DLookup("fldPsWd", "tblUsers", "fldUsers=" &
Me.txtUser.Value) Then
LoggedUser = Me.txtUser.Value
As far as I can tell, everything works just the same except, when it
comes time to execute this line of code I get a "runtime error 2001,
You cancled the previous operation."
I have looked all over everywhere and can't find an answer to this,
and I just don't understand why it works ok using a combo box but not
with a text field. All the values appear to be correct.
thanks for your help
greg
I am trying to convert some code I found on a web site to fit my
application.
I have a table named "tblUsers"
with the fields:
fldUserID - autonumber
fldUser - text
fldPsWd - text
I have a from named "frmLogon"
with a two txt fields named "cmbUser" and "txtPsWd"
the cmbUser field is a combo box which gets its value from the
tblUsers.fldUserID
the txtPsWd is a text box
here is the code triggered by a comand button on frmLogon:
If Me.txtPsWd.Value = DLookup("fldPsWd", "tblUsers", "fldUserID=" &
Me.cmbUser.Value) Then
LoggedUser = Me.cmbUser.Value
My problem is this:
As it stands, the code works just fine. However, what I want to do is
change the combo box "cmbUser" to a text field "txtUser" with the
following code:
If Me.txtPsWd.Value = DLookup("fldPsWd", "tblUsers", "fldUsers=" &
Me.txtUser.Value) Then
LoggedUser = Me.txtUser.Value
As far as I can tell, everything works just the same except, when it
comes time to execute this line of code I get a "runtime error 2001,
You cancled the previous operation."
I have looked all over everywhere and can't find an answer to this,
and I just don't understand why it works ok using a combo box but not
with a text field. All the values appear to be correct.
thanks for your help
greg