DoCmd.RunSQL "UPDATE[Table1] set[Comments] = Null, " & _
"[Field1] = 'Something Else', [Field2] = 3 " & _
" WHERE [Stock Number] = '" & _
Me.Units_Field & "' And " & _
"[In Use] = True And [Out Of Service] = True"
Incidentally, if you use
CurrentDb.Execute "UPDATE[Table1] set[Comments] = Null, " & _
"[Field1] = 'Something Else', [Field2] = 3 " & _
" WHERE [Stock Number] = '" & _
Me.Units_Field & "' And " & _
"[In Use] = True And [Out Of Service] = True", dbFailOnError
instead, you won't get prompted for "Do you want to update...", plus you'll
be able to trap any errors that might arise.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> I use the following RunSQL command to update a field in a table based on a
> single criteria. I would like to modifiy this command for multiple criteria
[quoted text clipped - 11 lines]
>
> Thanks for the help...........
JT - 20 Sep 2005 21:25 GMT
Thanks for the help. This is going to save me a lot of time...Thanks again...

Signature
JT
> DoCmd.RunSQL "UPDATE[Table1] set[Comments] = Null, " & _
> "[Field1] = 'Something Else', [Field2] = 3 " & _
[quoted text clipped - 33 lines]
> >
> > Thanks for the help...........
I always break up my SQL statements to make reading/changing them easier
as in.
strSQL = ""
strSQL = strSQL & "UPDATE [Table1] SET [Comments] = Null "
strSQL = strSQL & "WHERE [StockNumber] = '" & Me.Units_Field & "'"
Then to add an additional criteria simply add another line
strSQL = strSQL & "AND [OrderNumber] = '" & Me.OrderNumber & "'"
The DoCmd.RunSQL becomes DoCmd.RunSQL strSQL
> I use the following RunSQL command to update a field in a table based on a
> single criteria. I would like to modifiy this command for multiple criteria
[quoted text clipped - 11 lines]
>
> Thanks for the help...........