[AccessD] Setting Default control sizes in advance

John Colby jwcolby at ColbyConsulting.com
Fri Apr 7 01:04:59 CDT 2006


Arthur,

>Solutions requested!
>Client A wants 12 point Arial everywhere.
>Client B wants 10 point Times Roman everywhere.

Frameworks and SysVars.

I have not done that specific thing, but since my framework loads a class
for each form instance and each control type, for each instance of that
control type, it would be trivial for the text class to set the font/pitch
etc as the class loads.  That is the framework part.

SysVars say "for this FE make this property this specific value".  In other
words, I can have a SysVar named "CtlTxtBoxFont" the value of which is
Ariel, and another SysVar named "CtlTxtBoxFontPitch" the value of which is
12.  The clsFrm would have to be programmed to know about this SysVar, and
load that pair of SysVars,into its SysVar collection (each form class has a
collection to hold SysVars specific to that form), and then the clsCtlTxtBox
would have to ask the form what Font and Pitch to use.

I actually do this kind of thing, and in fact have the ability to have
SysVars specific to a particular form.  I do this by having a generic SysVar
such as CtlTxtBoxFontPitch which is set to 12 in the SysVarTable.  When the
form loads it looks for SysVars with its (the form's) name in the
SysVarName, for example frmClientCtlTxtBoxFontPitch.  Since When the
frmClient loads it scans all the SysVars looking for its name in every
SysVar.  If it finds any it strips its name out and "overrides" the generic
value with the value specific to itself.  Thus while all forms will load
CtlTxtBoxFontPitch and end up with a value of 12, frmClient may simply have
so many controls that it isn't feasible to use a 12 pitch so I can set
frmClientCtlTxtBoxFontPitch to 10 and only frmClient will use a 10 pitch
font.

I actually have this capability set up in my framework (SysVars and the
ability to override them for any specific form). For me it would be almost
trivial to set up to do something like you propose.

I did a similar thing with date formats.  Using DAO I drill down to discover
what type of data is being pulled out (for text boxes specifically).  If the
data type is a date, I have a default date format defined in a SysVar.  Thus
I can set a consistent date format via a sysvar, and if the client wants a
different data format, it is a simple matter of changing a single sysvar.

A framework is a very powerful concept and once set up and functioning can
allow implementation of behaviors that vary from front end to front end and
client to client.  

Sysvars allow the programmer to have "steering logic" in the application.
With default values in the SysVars you can have your applications "just
work" a specific way, and yet easily override that for a specific reason,
even down to the form level if desired.

John W. Colby
www.ColbyConsulting.com 


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Arthur Fuller
Sent: Friday, April 07, 2006 12:12 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Setting Default control sizes in advance

Occasionally I have posed on this site as a person who knows what he is
doing. Forgive me for that, since I know nothing.
I have a client who wants every single control on every single form to be
sized 12 point not the default 10. 
I have another client who is quite satisfied with 10 point.
Is there a way to establish a compiler directive or global var or whatever,
such that in App 1 the AutoForm will respect 12 point while in App 2 the
AutoForm will respect 10 point? (I only mention AutoForm because if it works
there then I assume it will work everywhere.) This same question probably
also extends to font (client A likes Arial, client B likes Times Roman). Can
this be done? Or must I continue with this inane form-by-form selection and
resizing ad nauseum?
Solutions requested!
Client A wants 12 point Arial everywhere.
Client B wants 10 point Times Roman everywhere.
I begin most of my forms based on an underlying query. I also (unlike many
on this list) define every lookup etc. thoroughly at the table level (i.e.
in the BE I state that CustomerID in the Orders table is a lookup into the
Customers table). I do this so that I can inherit the definition in all
subsequent forms and reports. I realize that many of you do not do this, and
I don't want this to get sidetracked into a discussion about that. I want to
concentrate on the question of how to default all AutoForms (and custom
forms too) to default to control-font-size = 10 v. 12 and control-font =
Arial v. Courier or something else.
Can this be done, and if so how?
TIA,
Arthur

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list