Access JumpStart 2.0 | Blog

A Rapid Development Framework for Microsoft Access

Today, my customer for whom I had enabled transactions was having problems with the update routine.

Ultimately, it stemmed from the fact that the Filter property is treated differently between the ADO recordset object and the DAO recordset object.

I had originally used an ADO recordset and when the .Filter property is set, it automatically applies the filter to the current recordset.

DAO on the other hand, requires you to open a new recordset, using the recordset object after you’ve set the filter:

 rsForecast.Filter = "ItemKey = '" & arrInvMast(0,I) & "'"
 Set rsForecastFiltered = rsForecast.OpenRecordset(dbOpenDynaset,dbSeeChanges)

With ADO, you just need the first line and then rsForecast would reload itself and you would continue working directly with it.

Each I guess would have it’s advantages, although the DAO usage is not at all intuitive and required me to look at the documentation. In any case, there are many subtle differences between ADO and DAO Recordset methods and properties, so make sure you know which one you’re using and if you switch, make sure you test and review the documentation!

Sign up For a Daily Email Adventure in Microsoft Access

Every business day (typically M-F), I'll send you an email with information about my ongoing journey as an advanced Access application developer. It will be loaded with my tips and musings.

    We won't send you spam. Unsubscribe at any time.