Re: Problem with runSQL Update
- From: fredg <fgutkind@xxxxxxxxxxxxxxx>
- Date: Thu, 15 Oct 2009 08:34:43 -0700
On Thu, 15 Oct 2009 08:19:27 -0700, James Frater wrote:
Hello All,
On the Click() event of a button I would like to run the update query:
SQL = "UPDATE Tbl_Booking " & _
"SET Tbl_Booking.PartDelete = False " & _
"WHERE Tbl_Booking.Ev_ID = ev_id"
docmd.runSQL SQL
However it fails to find or recognise ev_id, any thoughts on where I'm going
wrong? I'm guessing it's something blindingly obvious!
If it helps the button and the value ev_id are on a continuous subform
called "frm_EventRestore".
Many thanks
James
As written, your Where clause is looking for a literal ev_id as it's
critieria, not the value that ev_id contains.
The Where clause ev_id value must be concatenated into the expression.
Assuming ev_id is a Number datatype:
"WHERE Tbl_Booking.Ev_ID = " & ev_id
If in fact it is a Text datatype then use:
"WHERE Tbl_Booking.Ev_ID = '" & ev_id & "'"
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
.
- References:
- Problem with runSQL Update
- From: James Frater
- Problem with runSQL Update
- Prev by Date: Re: After Update Puzzle
- Next by Date: two issues
- Previous by thread: Problem with runSQL Update
- Next by thread: RE: Problem with runSQL Update
- Index(es):
Relevant Pages
|