Update query sytax help

Soma_rich

Registered User.
Local time
Today, 04:17
Joined
May 2, 2007
Messages
58
I know something is wrong with the update part of this sub can anyone see what i am doing worng?

Private Sub Check127_Click()

Dim randpass As Integer
Dim formJobNumber As Integer

Randomize randpass = Int((999999 * Rnd) + 100000)

formJobNumber = Forms![CyclicJobInput].JobNumber

DoCmd.RunSQL "UPDATE JobDetails, SET password =" & randpass & ", where JobDetails.jobnumber =" & formJobNumber & ";"



End Sub
 
Is password of a text or number data type? I would assume text so it should look like

DoCmd.RunSQL "UPDATE JobDetails, SET password ='" & randpass & "', where JobDetails.jobnumber =" & formJobNumber & ";"
 
Soma,

Remove this comma: UPDATE JobDetails, <---

Wayne
 

Users who are viewing this thread

Back
Top Bottom