vba - SQL UPDATE/WHERE Help... Updating columns not defined by WHERE -


basic sql update , access 2007 vba question. can explain me why query updating boxtype "60ct shipper tray" , not 60ct shipper pieces declared in where statement? thank you!

elseif me!txtboxtype = "60ct shipper tray"   'cases use 60tray more complicated. use 1 each of base, header, , display  'aswell 3 shelves.  qdf.sql = "update tblboxlist set qty = (qty+(" & me!txtqtychange & ")) boxtype = '60ct shipper base' or '60ct shipper header' or '60ct shipper display';" qdf.execute dbfailonerror 

you need include field name in each of conditions or together. use select query work out where clause logic.

select * tblboxlist         boxtype = '60ct shipper base'     or boxtype = '60ct shipper header'     or boxtype = '60ct shipper display' 

you might prefer approach instead.

where boxtype in     (         '60ct shipper base',         '60ct shipper header',         '60ct shipper display'     ) 

Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -