ChrisO Sample Files
I'm honored to be able to host sample files for ChrisO (Chris O'Brien). His disclaimer: "All these databases were created with Access 2003 and some use 32 bit API calls. As such they may not work with a 64 bit version of Access".
ChartLineSyntax The syntax of how to use VBA to change various properties in a Line Chart. Includes how to highlight minimum and maximum points on the Chart. Also included is a mouse move event to show the mouse position in chart engineering units over the plot area.
ChartLineZoom This sample shows how to drag, drop and resize a rectangle over a Line Chart Plot Area. When the Mouse button is released, another Chart is drawn showing the extents of the rectangle. This in effect draws a Zoomed version of the original Chart bounded by the rectangle.
ChartPieRotate This sample demonstrates how to rotate a pie chart so that the largest slice is at the top. It also includes a Report with the rotated charts.
CacheDatabaseProperties An alternative to using Global variables, which will be reset on a VBA Quit command, is to place those variables in database properties. The main reason not to do so is that they are slow to set and retrieve. A database property can take around 0.4 milliseconds to get and that is far too long. What we can do is cache, or mirror, database properties in a dictionary to improve speed. If done correctly it will reduce the retrieval time to around 2 to 3 microseconds. To avoid a possible clash with built-in properties we prefix the name of user properties with "User_". This is done automatically so that the programmer doesn’t even have to think about it.
If you have multiple versions of Access on your machine this A2003 version
should be converted to the highest version you have. Most runtime errors are
‘silent’ in that they are logged but allow other backups to be made. Unexpected
errors require the shutdown of the application to protect the data. A Report log
is available for the ‘silent’ errors but no attempt is made to log the
This backup utility can be invoked as a shortcut on the desktop or as a Windows scheduled task. In both cases the opening Form, frmSplash, starts a timer event. If that timer event times out the backup(s) will be made and the application will shutdown. If you choose to interrupt the timer you can enter setup mode to configure the backup list.
ControlsInstantiatedSubforms An Access Form may be something quite different from what we think. This sample uses an Access Form to be able to draw a rectangular panel meter. Since Access Forms can be instantiated, many such panel meters can be drawn at the same time on the same screen. The size and range of the meters can vary from instance to instance so it's just a matter of imagination.
DragAndDrop 1. The first in a series of four which demonstrates the ability to drag and drop controls at runtime. I got the technique to drag, drop and resize from a Russian site, I think the authors’ name was Lobodava. This is the most difficult of the four to learn so I have tried to keep the code to a minimum.
DragDropResize 2. The second in the series which uses the Drag and Drop and adds the ability to resize the control. In this sample the resizing is done on each of the four sides and not the corners.
DragDropResizeSnapSave 4. The fourth in the series which uses the Drag, Drop, Resize and Snap to Grid and adds the ability to save and reload the last sizes and positions. When the sample opens, you will need to select one of the Projects listed on the left.
DragFloorPlan This is a sample of how a drag/drop/resize/snap to grid/save may be used. All the items on the screen are Labels which have been altered to represent other items which may be found in a restaurant. Templates can be made if common areas, such as kitchen layout, are required. It’s just a matter of imagination.
DragDropPolygons See detailed description in zip file
DragDropChess Features: Drag and drop of pieces, castling, en passant capture, promotion. Move validation for all pieces, check highlighted for King and checking piece(s). A move which would place or leave its own King in check is rejected and returned to its starting position. Control Tip Text information for piece after move or rejection of move. Automatic replay of a game with pause/manual/continue. Manual stepping of a game, first, back, next and last.
Right click shortcut menu with: Resignation of side in play. Configuration; board colours, checking colours, directory, extension and times for replay. Import game from file. Export game to file. Export to email body. Export to email attachment. Links to rules of chess; Castling, En passant capture and Promotion.
DrawForms See detailed description in zip file
Forms_UpdateableCrosstabForm An updateable crosstab form
Forms_Shortcuts This sample shows how to use VBA to create a Shortcut Menu Bar based on the current record of a Form. Amongst other things it allows calling a Function and passing the value of the control which has the focus. You may also pass the primary key of the selected record. Those features are available via the right button of the mouse.
Note: In this sample, DbC.dbFailOnError does not override the DAO constant value
They can both exist in the same database without interaction. The reason for this is that, even though DbC.dbFailOnError is Public and has the same name as dbFailOnError, DbC.dbFailOnError is still a member of the class DbC and can not be referred to without the class name, DbC.
MakeDirectory A custom replacement for the VBA MkDir function
OpenArgs_Form Need description
OpenArgs_Report Need description
OpenArgs_Textbox Need description
Tabs_CurrentUser Need description
Z_Order_BoundObjects Need description
Z_Order_Labels Need description