How Microsoft Access Resolves VBA References

When Access needs to use the file you've referenced, it does so in the following sequence 1. It checks the location indicated in the References dialog box. 2. It checks to see if the file is already loaded. 3. It checks the RefLibPaths Registry key for a value in the name of the referenced file. 4. If the RefLibPaths key does not exist, or doesn't contain the required value, Access checks the Search Path in the following order a. Application folder where msaccess.exe is located C. System folder...

Using Transfer Spreadsheet to Create a New Worksheet

If you prefer not to use the CopyFromRecordset method, you can also use the TransferSpreadsheet method from the DoCmd object. There are a few distinct advantages to the TransferSpreadsheet method. One advantage is that you can export an entire table to a spreadsheet with one simple command. For example 'Use Transfer Spreadsheet to create an Excel Spreadsheet DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, Skids, i c skids.xls This code is all you need to export the Skids table to a...

Signed and Unsigned Integers

First, the C language uses something that is unknown to VBA unsigned numbers. VBA uses only signed numbers. An unsigned number is a positive number that is, it does not have a sign. A signed number can be either positive or negative because of the sign. VBA does actually support one unsigned data type Byte. For example, Figure 14-6 shows an 8-bit byte. Having a binary 1 in the most significant bit the eighth bit signifies that the number contained within the byte is a negative number. A 0 in...

Displaying Data in Tree View and List View Controls

Access Treeview Listview

One powerful feature of Access development is the capability to add an ActiveX control to a form or report. ActiveX controls are additional components that provide their own user interface, properties, and methods. Adding a control such as TreeView, ListView, or Calendar is a great way to add functionality to your applications with minimal effort on your part. ActiveX controls are not without cost, however. They must be installed on each computer to use them. In many cases, this means you must...

Basic Error Handling with an Extra Resume

One of the problems with basic error handling is that when an error does occur, you have no easy way of knowing the exact line that caused the error. After all, your procedure may have dozens or hundreds of lines of code. When you see the error message, the execution of your code has already jumped to your error handler routine and displayed the message box you may not be able to tell which line caused the problem. Many programmers rerun the code, using debug mode, to step through the code to...