Docmd runsql not updating

There are a number of ways to execute a SQL Data Manipulation Language (DML) statement from Microsoft Access, besides the obvious process of creating an Action Query and double-clicking its icon.Understanding your options with respect to executing SQL will make your code cleaner, give you more flexibility and we'll even throw in a great debugging feature as an added bonus.Thanks for everyone's help in advance.....you've been GREAT thus far!!!!!If you have the choice, Open Recordset is inferior to the other two, because it involves VBA interpreting compiled code within your record loop.Open Recordset([tablename / sql])myrecordset.editmyrecodset.fields("myfield") = [somevalue]myrecordset.update TIAMichelle Well, whichever way is faster, SQL Update vs Recordset, Do Cnd, Run SQL is a very inefficient way to execute a SQL command, and there are other good reasons not to use it from code. Execute method of a DAO Detabase or Query Def object, or of an ADO Connection or Command object.

It is designed for DML SQL, such as UPDATE, INSERT and DELETE statements.Run SQL is an Access function, while Execute is a DAO function, but I would think that Run SQL simply calls Execute against the current database. Because Run SQL (like most Do Cmd methods) is available to Access macros, while Execute is only available to code.Rick Sprague Excellent explanation, but (correct me if I'm wrong, by all means), an ADO approach is probably desireable with it's future in dot Net and usefulness in other approaches such as web development.Dim var Return As Variant var Return = DLookup("[User1]", "tbl Database", "[UID]= " & Me. Run SQL "UPDATE tbl Database SET User1='" & [Temp Vars]![var User] & "'" End If The following command line is updating me the whole table, instead of updating only the selected record. You need to include a Where clause, otherwise the entire table gets updated. Run SQL str SQL Now you click the button that runs that sub.