Minimizing stateful code

First we need to define what a state is. A state means that the object has variable(s) that may cause it to behave differently, depending on the content of the variables. As an example, the Forms collection is stateful: This is legal code and will compile but we can’t be assured that this will work…

Microsoft Access File Extensions

Microsoft Access saves information under the following file formats: File Format Extension Access Project (2007, 2010) .adp Access Blank Project Template (2007, 2010) .adn Access Database (2007, 2010, 2013, 2016) .accdb Access Record-Locking Information (2007, 2010, 2013, 2016) laccdb Access Web App Reference .accdw Access Signed Packages .accdc Access Database, used for Add-ins .accda Access…

Truthy and Falsy Values

“Truthy” and “Falsy” Values

VBA is quite very loose in what it deems “truthy” and “falsy”. For example, this procedure can produce surprising result: At the first glance, it seems expected that if the bit field is set to , it would succeed. But in fact, it wouldn’t because is equivalent to , not . Unless we convert the…

Use TryGet pattern for transient values

A number of objects may have extra properties or something where it might not exist for all instances. A good example might be finding property on an variable: Not all controls have a property and thus can fail to run. A common approach is to use OERN: This will work OK but this can significantly…

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…

Access InStr() function to SQL Server equivalent

What is the SQL Server equivalent to Access InStr() function? TargetField: String expression being searched SearchValue: String expression being sought StartPosition: Starting position for each search (optional) Access SQL SQL Server