DoCMD Update problems

bbwolff

Registered User.
Local time
Tomorrow, 00:10
Joined
Oct 1, 2013
Messages
116
Code:
 If Me.txtPassword.Value = DLookup("UPass", "Users", "[UserID]=" & usID) Then
  
  user = Me.txtUName.Value
newpass= Me.txtPassNew.Value

  DoCmd.RunSQL "Update  Users set Upass=newpass where Uname=user"
  End If

why is this routine asking me for values for user and newpass.
it's the same if i use the variable or just values of the textboxes
 
You have to concatenate the values into the string, similar to the DLookup criteria.
 
like this?

Code:
 DoCmd.RunSQL "Update  Users set Upass='" & Me.txtPasswordNew.Value & "' where Uname='" & Me.txtUName.Value & "'"
 
If it works, yes. ;)
 
had some other problems so it looked like it didn't work, fixed it now, tx
 

Users who are viewing this thread

Back
Top Bottom