Setting Your Forms And Reports In Access As The Defaults

Setting Your Forms And Reports In Access As The Defaults

If you are regular as clockwork like me (I mean creating Access databases that is), then setting your forms and reports in Access other than using the ‘Normal‘ blank default should help – but does it?

Just to bring everyone else up to speed, you can set your MS Access form and report defaults by typing the name of your custom form or report in place of the standard ‘Normal‘ option which means all new objects will inherit these designs as the template style going forward – saving you some extra design time!

forms and reports in access defaults

To set your defaults:

  • for Access 2010/2013 go to  File | Access Options |  Object Designers,
  • for Access 2007 go to the Office Button | Access Options | Object Designers,
  • for Access 2003 (and earlier) go to  Tools | Options | Forms/Reports.

However, your forms and reports will not inherit all the properties or any VBA code and if you are going to go to the bother of overriding the defaults, one normally wants to provide a rich alternative which includes the extra advanced properties and some generic Access VBA code.

The easiest way therefore would simply be to copy and paste the object via the Navigation Pane (or Database Window for earlier versions) instead of using the default options as all attributes including code will follow on.

Setting Your Forms And Reports In Access As The Defaults

So here’s what you can do…

Design your form and report using the blank option and set all the properties you think will be considered a global standard to all other objects will be based. They should include some of the following where applicable (versions) and object types (forms and reports):

Allow Design Views Only – This only applies to version 2003 or earlier where it was available and prevents users seeing the properties dialog box appear during normal viewing mode (run time). Luckily it was dropped as it was a waste of time!

Allow PivotTable View – As introduced and then later dropped in Access 2013 this view is not really considered a normal output – Excel is better! Set it it ‘No‘.

Allow PivotChart View – as above.

Width – Set a standard width for your form. For example something like 15cm which can be found under the ‘Format‘ tab for the form.

Caption – Set this to be something easy to edit and change so it acts as a reminder to change the caption as part of the finishing touch. I use uppercase with something like ‘[ADD YOUR TITLE HERE]’.

Default View – Decide which default view you want or set the ‘Allow … View‘ to ‘Yes‘ and ‘No‘ respectively. If you need a form view and a datasheet view, then you will end up with two form templates variations.

Dialog Box Pop up? – For a dialog pop up window view, consider setting ‘Auto Center‘, ‘Auto Resize‘ and ‘Pop Up‘ properties (‘Yes‘). Even consider making it modal too using the ‘Modal‘ property (set to ‘Yes‘).

Margins – make sure your reports will fit as much data as possible by reducing the margin dimensions.

Report Header/Footer – allow enough height being used for a report and show these sections as they are probably going to be used more often than not.

The more time you spend setting properties that will rarely change, consider adding and applying them during the template design time.

In addition, adding controls namely Textboxes, Labels and Shapes will enhance your standard forms and reports in Access further which too can be used to copy and paste for each instance.

Adding an unbound Textbox in a form for example with the formatting in place can be very useful in creating the standard look and feel. All you would need to do is copy and paste and attach it to a bound field ready for populating their values from the record source.

Having a Textbox in the header section of a report referring to its title (or caption) with the expression =[Report].[Caption] will dynamically calculate the title for your report based on the ‘Caption‘ property as set. This can be extended for a date, time and page numbers control Textbox to the footer area too.

What about the Access VBA code?

This is where you can save a lot of time setting your predefined procedures all wrapped up ready to go.

For example, in a report, if you set the ‘On No Data‘ event (via the Event tab) to a predefined VBA function called ‘NoRecords‘, it will handle a user friendly and graceful way to control how the report is executed.

For a form, you may want internally set a private variable using the ‘OpenArgs‘ property (if in use) to handle processing later on in the form.

Without going into too much detail with code illustrations which is an advanced way to create richer objects, you can really take control on the defaults.

I then save all my templates with some sort of prefix like ‘frm_TEMP_xyz‘ or ‘rpt_TEMP_xyz‘ and in later versions group them into a custom group folder for ease of use.

All you would then need to do is copy and paste, rename the object to a more meaningful reference and use and change the caption and modify further.

Ideas for creating good forms and reports can be found in my eBook bundle series.

This entry was posted in Forms, MS Access, Reports and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Confirm you are human.