Why does Excel have a problem when using code in Access?

When you use code to refer to Excel (and other programs as well) you need to be careful not to use any code that does not refer back to the instantiated application object. If you do so then you will find that Access instantiates another Excel (or other program) object which is not visible to…

Hiding the Navigation Pane with VBA

Once you have created an Access Database Application to be used by other people, it may well be important for you to prevent users from gaining access to any of its design features. By this I mean, you may not want users to modify your tables, forms and queries etc in design view (inadvertently or…

#LateBind Constant

In standard code, we make use of #LateBind conditional compilation constant, which is typically defined via project’s Conditional Compilation Argument in the dialog: NOTE: The dialog can be found via Tools → <project name> Properties, which is located below the Options menu item. The menu item caption will be different as it includes the project…

Using Custom Functions in Calculated Controls

Custom functions work the same way as MS Access built-in functions such as DateAdd, DatePart and DSum, but are instead created ourselves as database developers.  We do this by creating a public function with the VBA programming language and save it inside a global module within the database. Today I am going to explain how custom functions can be…

Unrecognized Database Format

Access 2010: Unrecognized Database Format

I’ve been seeing more and more people having problems with the Unrecognized Database Format when creating or modifying an Access 2007 (accdb) format database in Access 2010 and then trying to open it again in Access 2007. The issue appears to be that Access 2010 does not have its own file format. When you add a…

Use controls, not fields

Sometimes we need to use fields from a RecordSource that aren’t shown on the form. It is legal to reference them directly even if they don’t have a control. For example, we can have a form bound to a RecordSource like so: And only display in a textbox but not show the . In code,…