update query with criteria from form user input (1 Viewer)

K

kernelsan

Guest
hello, sorry if i ramble a bit i want to be thorough :) I have an update query which i have assigned to a button on form. the form shows the records in tblJOBS. the form has a field which shows the jobID of the current record
and a show next record button etc
the update query is:
UPDATE tblJOBS SET tblJOBS.JobID = forms!frmJOBS!JobID

it is supposed to update the record with the value shown in the currently opened record in the form. However it actually updates every record in the table with the value in the currently open jobID control.
Is there any way i can change this query to update only the current record shown in the form?

thanks alot for any help
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:11
Joined
Aug 30, 2003
Messages
36,118
You need to add a WHERE clause. Perhaps something like this, though I'm guessing:

UPDATE tblJOBS SET tblJOBS.JobID = forms!frmJOBS!JobID WHERE tblJOBS.KeyField = Forms!frmJOBS!KeyField
 
K

kernelsan

Guest
thanks alot matey, that worked a treat :)
 

Users who are viewing this thread

Top Bottom