I have a question about the Recordset Update method in Access 2010 VBA using the DAO.Recordset. If I add a new record using the .AddNew method, where is the record inserted? At the end of the query regardless of the sort declared in the .OpenRecordset method? And if i add a new record that does not meet the criteria in the .OpenRecordset method, it will be added to the table, but is it added to the recordset? Example is below...
Is the new record added to the recordset? If so, where?
Is the new record added to the recordset? If so, where?
Code:
Dim db as database
Dim rs as DAO.Recordset
set db = CurrentDB
set rs = db.OpenRecordset("SELECT * FROM [a query] WHERE [theDate] < #" & _
dateVariable & "# AND [Change] = 0 ORDER BY [theDate]")
'add a new record
rs.AddNew
rs![theDate] = dateVariable 'the same date as the statement above
rs![Change] = 1 'in the SQL statement above...Change=0
rs.Update