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…
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…
Pivoting a dynamic set
SQL Server does not allow for a dynamic set, which can be problematic if you need to pivot based on the data that comes from rows and you can have various values in the column. In general, you need a stored procedure and dynamic SQL in order to handle the dynamic pivots. This requires uses…
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…
Designing a lookup table with logic
It is very common for us to embed some kind of logic based on a lookup table or in some cases, a column of a table. Because we have application logic connected to it, the code are fragile and subject to changes as the requirements develops. We want to avoid this situation where we might…
Microsoft Access 2003 Language Reference [Access 2003 VBA Language Reference]
This reference contains conceptual overviews, programming tasks, samples, and references to guide you in developing solutions based on Microsoft Access. The reference contains the following sections: What’s New: Provides a list of new members by object and in alphabetical order. Concepts: Provides important concepts for developing custom Access solutions. Reference: Provides reference materials for the Access…
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…
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