Create sequential ID value based on the year that a record is added

With Access versions 2010 and later you can use an event-driven data macro to generate the sequential ID. For example, say you have a table named [poledata]. Open it in Design View and add two fields: alternate_id_seq  –  Numeric (Long Integer) alternate_id  –  Text(20) Save the changes to your table and then switch to Datasheet … Read more

Working with Unicode file names in VBA (using Dir, FileSystemObject, etc.)

It sounds like you are being misled by the fact that while VBA itself supports Unicode characters, the VBA development environment does not. The VBA editor still uses the old “code page” character encodings based on the locale setting in Windows. Certainly FileSystemObject et. al. do in fact support Unicode characters in file names, as … Read more

Storing an image into an Attachment field in an Access database

As you have discovered, you cannot use a SQL statement to insert files into an Attachment field in an Access database. You have to use the LoadFromFile() method of an ACE DAO Field2 object. The following C# code works for me. It is adapted from the Office Blog entry here. using System; using System.Collections.Generic; using … Read more