Access MVP (2010-2015)

oOo.oOo.oOo.oOo.oOo.oOo

UPDATE Query Samples

Simple UPDATE query…

UPDATE YourTable SET YourTable.YourField1 = "Your Value";

Update a field in your table with values from another field in your table…

UPDATE YourTable SET YourTable.YourField1 = [YourField2];

Update a field based on a field on your form…
Note:  The form must be open to perform this action!

TEXT

UPDATE YourTable SET YourTable.YourField1 = "YourValue"
WHERE (((YourTable.YourField2)=[Forms]![YourFormNameGoesHere]![YourTextBoxOrComboBox]));

NUMERIC

UPDATE YourTable SET YourTable.YourField1 = 1234
WHERE (((YourTable.YourField2)=[Forms]![YourFormNameGoesHere]![YourTextBoxOrComboBox]));

Remember…  Change the names to match your Fields, Tables, Forms, Controls, etc… to match yours.

 518 total views,  1 views today

Comments are closed.