Wednesday, March 24, 2010

Access 2007 Bug: Template 'xxx.accdt' could not be instantiated.

There is a newly reported bug in Access 2007 which prevents the instantiation of a database (accdb) from an Access template (accdt).


Template 'xxx.accdt' could not be instantiated.
An unexpected error occurred when opening the template.

Cause:
The XML encoding of the "&" symbol when used in the name of a database object like a table, query, form, report, macro or module.

Reproduce The Error:

  1. Name a database objects (form, report, etc.) with an '&' in the object name.

  2. Create a template (accdt) from the database.

  3. Double-click the saved accdt file.

  4. The instantiation will fail when it tries to create the object.
Workaround:
Avoid using the & in any database object name.

Comments:
It doesn't appear to be an issue when an '&' is used in a control within those database objects.  It also does not seem to effect the original database or creation of the template, just instantiating a new database from the template.

Yet another good reason NOT to use non-standard characters in your object names.

Monday, March 1, 2010

New Sample: Form_A2K7_Attachments

Form_A2K7_Attachments

by A.D. Tejpal

This sample db demonstrates a user friendly approach for handling attachments in Access 2K7, without invoking the dialog box for attachment management.

As the user navigates to a given record on the sample form, names of documents held by attachment type field get displayed in a list box. Simultaneously, total count of attached documents gets displayed adjacent to the attachment control.

Appropriate command buttons provide following features:

(a) Insertion of new documents:

On clicking this command button, file open dialog box gets displayed, enabling selection of one or more files, which get added to the attachment field. Simultaneously the status of list box as well as attachment counter text box gets updated.

(b) Removal of attached documents:

Based upon selection of one or more (or all) documents in the list box, the selected items get removed from the attachment field. Simultaneously the status of list box as well as attachment counter text box gets updated.

(c) Extraction of source files from attached documents:

Based upon selection of one or more documents in the list box, source files for the selected items get extracted into a temporary folder named ZZZTemp. This folder gets created if missing and is placed in the parent folder holding the db. The status of extracted documents gets displayed in a list box adjacent to the one showing attached documents.

Note: Even if the temporary folder contains large number of extracted files pertaining to various records, only those relevant to current record get displayed in the list box.

(d) Deletion of extracted files:

Based upon selection of one or more (or all) extracted files in the list box, the selected items get deleted from the temporary folder. Simultaneously the status of list box gets updated.

(e) Opening of extracted file:

Based upon selection in the list box, the extracted file gets opened in its parent application.

Version: Access 2K7 accdb File Format
 
You can find the sample here: http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=531
 
.

New Sample: Form_GanttChart

Form_GanttChart

By A.D. Tejpal

This sample db demonstrates depiction of Gantt charts on forms. Two styles are covered:

(a) Style A: Using Bound controls

(b) Style B: Using Unbound controls

Style A is editable. As the user enters start and end dates for various tasks, the chart string gets updated automatically. Simultaneously, the month / year markers at top get updated, duly taking into account the overall time span from start of earliest task to finish of last task.

Version: Access 2000 File Format

You can find it here: http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=530

.