New MS Access Expressions (VBA)

Tech on the Net is a good resource. Dsum is a useful function:

In Microsoft Access, the DSum function returns the sum of a set of numeric values in a specified set of records (or domain). DSum ( expression, domain, [criteria] )

Doing work for NYGC's database, I almost got stuck with a null problem (Runtime error 94, invalid use of null) while using DSum. Problem solved not with IIf Null, but with another function Nz: Nz function lets you return a value when a variant is null. Nz ( variant, [ value_if_null ] )

And with form properties using combo dropdown lists/boxes with multiple columns of a table but showing just one field that's usually default to the primary index column (or retrieving data from table that has primary index which becomes the main reference point for the other field), but the column is the intended object, use: Me.YourComboBoxName.Column(x) where x is the column number (from 0 to *) of the table sourced.

This entry was posted in Technical. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.