Default control properties (font, size, height, ...)

D

Dale Fye

A couple of days ago, I finally figured out (after many years of using
Access) how to change the default properties for controls, so that when I add
a control, it gets created with the font, size, height, and other properties
I want. I cannot believe it took me all these years to figure this out. :-(

I did this in a database I'm working on, but today, these values have
returned to their original numbers. Does changing these values only effect
the current session? Or is there something special I need to do to save they
values so they apply whenever this database is opened? Or is there something
I can do so that they are the same, whenever I use Access?

Dale
 
S

Steve Sanford

Hi Dale,

I found this in Help:

*About setting defaults for a control type*
------------------------------------------------
<snip>
Once you reset a control's default control style, all subsequent controls of
that type that you add to the current form or report will have those property
settings.

The default control style remains in effect for *that form or report* until
you change it again. If you want the new settings to apply to all new
controls, you can make the current form or report a template.
<snip>


and

*About using a template to create a form or report*
-----------------------------------------------------------

When you create a form or report without using a wizard, Microsoft Access
uses a template to define the default characteristics of the form or report.

The template determines which sections a form or report will have and
defines each section's dimensions. The template also contains all the default
property settings for the form or report and its sections and controls.
However, a template doesn't create controls on a new form or report.

The default templates for forms and reports are called Normal. However, you
can use any existing form or report as a template. You can also create a form
or report to use only as a template. Changing the template doesn't have any
effect on existing forms or reports.

Microsoft Access saves the settings for the Form Template and Report
Template options in your Microsoft Access workgroup information file, not in
your Microsoft Access database (the .mdb file) or Microsoft Access project
(the .adp file). When you change an option setting, the change applies to any
Access database or Access project you open or create.

If your templates are not in an Access database or Access project, Microsoft
Access uses the Normal template for any new forms and reports you create.
However, the names of your templates appear in the Form Template and Report
Template options in every Access database or Access project in your database
system, even if the templates are not in every Access database or Access
project.



So I did a little testing:

Create an new blank MDB. Set up a form like you want it, then set up the
defaults for the controls (you don't have to add any controls to the form)
and save the form... I used "DefaultForm".

Under TOOLS/OPTIONS, click on the FORMS/REPORTS and set the default form to
the form you just created ("DefaultForm"). In the database window, right
click on the form (do not open it), then click the "Hidden" attribute. Save
the MDB, naming it something like "DefaultMDB".

When you want/need a new database, copy the "DefaultMDB", then rename it. If
you don't use the wizard to create new forms, any forms you create will have
the form and control defaults like you want them.

Now I have to get busy and set up my defaults. :)
Thanks for the nudge...

HTH
 
D

Dale Fye

Thanks, Steve.


Steve Sanford said:
Hi Dale,

I found this in Help:

*About setting defaults for a control type*
------------------------------------------------
<snip>
Once you reset a control's default control style, all subsequent controls
of
that type that you add to the current form or report will have those
property
settings.

The default control style remains in effect for *that form or report*
until
you change it again. If you want the new settings to apply to all new
controls, you can make the current form or report a template.
<snip>


and

*About using a template to create a form or report*
-----------------------------------------------------------

When you create a form or report without using a wizard, Microsoft Access
uses a template to define the default characteristics of the form or
report.

The template determines which sections a form or report will have and
defines each section's dimensions. The template also contains all the
default
property settings for the form or report and its sections and controls.
However, a template doesn't create controls on a new form or report.

The default templates for forms and reports are called Normal. However,
you
can use any existing form or report as a template. You can also create a
form
or report to use only as a template. Changing the template doesn't have
any
effect on existing forms or reports.

Microsoft Access saves the settings for the Form Template and Report
Template options in your Microsoft Access workgroup information file, not
in
your Microsoft Access database (the .mdb file) or Microsoft Access project
(the .adp file). When you change an option setting, the change applies to
any
Access database or Access project you open or create.

If your templates are not in an Access database or Access project,
Microsoft
Access uses the Normal template for any new forms and reports you create.
However, the names of your templates appear in the Form Template and
Report
Template options in every Access database or Access project in your
database
system, even if the templates are not in every Access database or Access
project.



So I did a little testing:

Create an new blank MDB. Set up a form like you want it, then set up the
defaults for the controls (you don't have to add any controls to the form)
and save the form... I used "DefaultForm".

Under TOOLS/OPTIONS, click on the FORMS/REPORTS and set the default form
to
the form you just created ("DefaultForm"). In the database window, right
click on the form (do not open it), then click the "Hidden" attribute.
Save
the MDB, naming it something like "DefaultMDB".

When you want/need a new database, copy the "DefaultMDB", then rename it.
If
you don't use the wizard to create new forms, any forms you create will
have
the form and control defaults like you want them.

Now I have to get busy and set up my defaults. :)
Thanks for the nudge...

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top