========================================================================
FIRSTLIB.MDA
========================================================================

ABOUT FIRSTLIB
--------------

FIRSTLIB is a Microsoft Access library database designed to make 
designing databases a little easier.

FIRSTLIB works like most other library databases in that it is accessible
from any database you are currently using/designing/creating.  Unfortunately,
there is no way to make FIRSTLIB immediately accessible through a menu 
command, so accessing the Form Design tools provided in FIRSTLIB is 
not as clean as, say, creating a new Wizard.

To get around this problem, I've included an Autokeys macro that you can
import into any database that you are currently working on.  Once 
imported, if you have FIRSTLIB.MDA correctly installed, you are a
keystroke away from the tools provided.


DISCLAIMER
----------

FIRSTLIB.MDA is provided "as-is" without warranty of any kind,
either expressed or implied, including byt not limited to the 
warranties of merchantibility and/or fitness for a particular
purpose.  The user assumes the entire risk as to the accuracy
and the use of this Microsoft Access Library Database.

FIRSTLIB.MDA may be freely copied and distributed subject to the
following conditions: 1) This document must accompany FIRSTLIB.MDA;
2) FIRSTLIB.MDA should not be modified in any way; 3) FIRSTLIB.MDA
may not be distributed for profit.

FIRSTLIB.MDA is not supported by Microsoft.


INSTALLATION
------------

To install FIRSTLIB.MDA, open MSACCESS.INI in the Windows directory, and
add the following option:

[Libraries]

  firstlib.mda=ro

If FIRSTLIB is not in your Access directory, you should probably
specify the full path, rather than just the filename.  You must exit and
restart Access for the change to take effect.


WHAT'S INCLUDED
---------------

There are three main tools that FIRSTLIB provides: A Form Design
tools library, a Macro to Module converter, and an expanded
New Procedure dialog for writing Access Basic Code.  Each of these
three tools can be accessed by running a function in the Immediate
Window, or by pressing a key if you have imported the Autokeys 
macro.  The table below shows how to invoke each of the tools.


TOOL        FUNCTION NAME       AUTOKEY
---------
Form Design Tool Palette        flib_OpenFDTools        Shift-F12
Macro to Module Coverter        flib_ConvertMacros      Ctrl-F12
Extended New Procedure Dialog   flib_NewProc            F12


So, if you want to convert macros to modules, you can go to the
Immediate Window and type:

  ? flib_ConvertMacros()

or simply hit Ctrl-F12 if you have the Autokeys macro loaded.  (Note
that the Extended New Procedure Dialog is only applicable in a module,
so you must have a module active for this function to work.)



THE TOOL PALETTE
----------------

FD Tools is a collection of form design tools that can be used with
any form.  At present, these tools cannot be used with reports, but
this should change soon.  

The tool palette contains 2 rows of 6 tools.  Each has a nifty little
icon, but I can't show those here (since this is a text file).  Instead, 
I will reference each tool by its row and column, in the format R1C1, 
R1C2, etc.

R1C1: Sunken Frame
------------------
This tool will put a sunken rectangle behind *any* control, including
subforms, listboxes, dropdowns, etc.  If you change the size of the
control, and then click the Sunken Frame button again, FIRSTLIB
will find any existing frame and simply resize it.  FIRSTLIB finds
existing rectangles by first looking at the control name for all
rectangles on the form.  If the control name is of the pattern
"FieldNameFrame" and you are trying to frame "FieldName," then
"FieldNameFrame" will be resized.  If no rectangle is found with the
correct name, FIRSTLIB will look for a rectangle that is overlapping
the control in question.  If this search returns no rectangles, then
a new frame is created.

R1C2: Shadow Frame
------------------
This tool follows the same rules as the Sunken Frame tool above, but
it creates a frame that looks like a shadow, very similar to the Wizard
Shadow style.  You can easily switch an exisitng Sunken Frame to a
Shadow Frame and vice versa.

R1C3: Size Object
-----------------
This tool brings up the dimensions for an object in TWIPS.  On this
dialog you can change, Top, Bottom, Left, Right, Height, and Width.
In the future, I plan to make the measurement settable, so you could
specify dimensions in twips, inches, and/or centimeters.

R1C4: Make Controls Same Size
-----------------------------
Clicking this button will bring up a list of all the controls on the
active form.  You can then select the controls that you wish to apply
this operation to.  Next, simply specify the new height and width for
all of the selected controls and click OK.  The controls will be
resized to the same height and width.  If you leave the height or
width field blank, it will be ignored when sizing the controls.
NOTE: The Unit of Measurement option group has no effect.  All measurements
are still in TWIPS.

R1C5: Vertical Alignment Tool
-----------------------------
This tool works much like R1C4 in that a list of controls is brought
up and you are allowed to select the controls you wish to apply the
operation to.  The vertical alignment tool will take each control
you selected, in the order that you selected them, and space them
evenly on the form according to the spacing you have specified.

NOTE: There is currently a bug here in that the controls you have
selected are not sorted by the time that they were selected.  I
will fix this soon.

R1C6: Horizontal Alignment Tool
-------------------------------
Same as the Vertical Alignment Tool only horizontal.  Great for
simulating datasheets in form view.

R2C1-R2C4: Alignment Tools
--------------------------
These four tools are essentially short cuts for the menu options
Align Left, Align Right, Align Top and Align Bottom.

R2C5-R2C6: Bring To Front / Send To Back
----------------------------------------
Another group of short cut buttons for another group of commonly
used menu options.



MACRO TO MODULE CONVERTER
-------------------------

When you invoke the Macro to Module Converter, a dialog will appear
that lists all the Macros in the current database.  After selecting
a Macro to convert, you must provide a valid file name.  FIRSTLIB
will write the Basic equivalent to the macro directly to this file.
Once complete, simply load the file into a module as text, and you're
ready to go (almost, see below).

All of the conditions that you specified in the Macro will be
converted to "If" statements, and support for "..." is included.
Certain Actions will be converted to the ABC equivalent (like
MsgBox), and others will not be included at all (like AddMenu),
but the majority of actions will be converted to the "DoCmd Action"
format.

The dialog provides two options that control the format of the code
that is generated.  The first option, Include Error Handling Code,
will automagically add the appropriate 'On Error' type stuff if
it is checked.  If an error occurs, a MsgBox will give a description
of the problem.

The second option, Include Function Names in Error Dialogs, is only
applicable if the first option is checked.  If selected, this second
option will place the title of the function in the title of the MsgBox 
that is shown when an error occurs.



EXTENDED NEW PROCEDURE DIALOG
-----------------------------

When writing basic code, you can quickly add a new procedure by choosing
[Edit] [New Procedure] from the menu.  Unfortunately, this option 
provides relatively simple procedure creation functionality.  

The Extended New Procedure dialog allows you to specify not only the
name and type of the procedure to add, but also the return value
(if the procedure is a function) and comments (if you wish).

Furthermore, FIRSTLIB can also automatically generate error handling
code as described in the previous section.

Once you've described the function that you wish to create, click the
OK button and the function will be created in the currently active
module.  Note that FIRSTLIB uses SendKeys to create the function, so
if you provide a duplicate function name, disaster could be the result.
For the most part however, functions should be added quickly and
cleanly.



QUESTIONS/COMMENTS
------------------

If you have questions or comments about FIRSTLIB, please contact
me directly through EMail: andrewm@microsoft.com.

