update query

lipin

Registered User.
Local time
Today, 20:34
Joined
May 21, 2002
Messages
149
I am trying to use the following update query to change a user's password. THis query runs on a command button. There are three textboxeson my form 'frmChangePassword'
: current user's ID (txtClockNum)
new password (txtNewPass)
confirm password (txtConfirm)

if the passwords match the command button to change the password is enabled. that works fine.

The tbale is 'tblpassword' has two fields:'ClockNumber' and 'Password'

When I hit the button it asks for the ClockNumber --> but I amtrying to use the WHERE line to get this from the textbox on the form. So if I type in the clock number (the same as the one in the textbox!) it runs and updates the password of all records not the one with the corresponding Clock Number.


UPDATE tblpassword
SET Password = [forms]![frmChangePassword]![txtNewPass]
WHERE ClockNumber = [forms]![frmChangePassword]![txtClockNum];

Can anyone help me with this?
 
Check your references again. The only reason it would be prompting you, is that it can't find it, so it figures it has to go to the user to get it. Are you using the Build ... to help create the correct references? You might want to re-write that statement with the assistance of Build .... (Right-Mouse click if you are in VBA)
 

Users who are viewing this thread

Back
Top Bottom