Tips and Tricks for working with Microsoft Access Forms

ALT Shortcut to a Controletc eg =[Cost] + [Shipping]
Place a & before the letter you want to act asShow a Blank Record Only
the ALT shortcutProperties [Data] Data Entry property set to Yes
Use && to display a literal &.To see all Records Records | Remove Filter/Sort
Keeping Controls Aligned
Making Small Adjustments to the Size and Position ofHold down shift whilst moving a control – you will
Controlsonly be able to move vertically or horizontally, not in
CTRL arrow keys – positionboth directions.
SHIFT arrow keys - sizeHave a form change Colour as different Fields are in
Focus
Showing the Current Date and TimeControl property [Event] On Enter property -
In design view – Insert | Date and TimeForms![FormName].Section(0).BackColor =nnnnn
Using ImagesSame code for On Exit property to change the colour
You can cut and paste from image software – usewhen exiting the control.
the selection tool in the image software to copy overSet Defaults for Tools
a portion of the image.When you resize the UnboundView | Properties and then click the tool on the toolbox
Object Frame the picture by default will crop. ChangeFor text boxes without labs change Auto Label
the Size Mode property to Stretch or Zoom. Stretchproperty to No
will change the proportions of the image to exactly fit
the frame, Zoom will change the size but not theCreate Straight Lines
proportions.Hold down shift
Double- click on the image to edit it.Conditional Formatting on Text Boxes
Convert the unbound object frame to an image controlOn Exit Property add the following:
(bitmap) to save disk space and have the form openIf Date < Now() Then    Date is the field name,
more quickly:Right click on the image Change To |Me!Date.BackColor = 255    Me! is an Access
Image. The image cannot be edited once it isoperator
converted.Else
To have an image in the form background:Me!Date.BackColor = 16777215
In design view, go to the properties for the form:End If
Format tab | Picture (Build button) – select theOr use the conditional formatting option
picture you wantPrevent an Object from Printing
In the Picture Type property choose Embedded orObject Properties [Format] – Display When
linkedproperty – Screen Only
Set the Picture Size Mode property as desired.Add a Screen Tip to a Control
Prevent Data EntryControl Properties [Other] – ControlTip Text
Properties: [Data] – set Allow Deletions and AllowHave a Form Close Automatically after a Period of
Edits to No.Time (Splash Screen)
Change the Grid Spacing in Design ViewCreate a Macro – Action = Close
Form Properties [Format] Grid X, YSave the Macro
Specify a Control to Focus On When the NewForm properties [Event] – Timer Interval property (1
Record Button is Usedsec = 1000), On Timer property – select the macro.
Create the New Record button and open theWhat’s the Difference Between a Bound and an
Properties Event tabUnbound Object Frame
Click on the build button, and after,A bound object is linked to a field in a table and
‘DoCmd.GoToRecord , , acNewRec’therefore changes with each record. An unbound
TypeForms![FormName]![ControlName].SetFocusobject is an object that appears in each record
Close and Return to the Access and save the form.Export A Form and a Sub Form to Excel
Disable the Ability to Switch Between Form ViewsThe only way to do this is to create a query that
Properties [Format] Select No for views not allowedincludes the two sets of data (linked) and export this.
Change default view to one of the views allowed.Validation – Forms vs Tables
Prevent Editing at the Control LevelIf a different validation rule is applied to a control, than
Properties [Data]the rule applied to that field in the underlying table, both
– to prevent editing set the Locked property to Yesvalidation rules are taken into consideration.
- to dim the control so that it can’t be selected setShowing all records in a Subform when Printed
the Enabled property to No.In subform, Properties for detail section [Format] Can
grow property – set to Yes
Shortcut key to Move between Header and Detail
SectionsOpen Up a Separate Form to Show Related Records
F6Create a command button under Form Operations
– choose Open Form
Have a Form Open Automatically when the DatabaseSelect “Open form and find specific data to
is Openeddisplay”
Create a new macro.Select the fields that link that tables on both sides and
Under Actions choose OpenFormlink them using the <-> button.
In the Actions pane, under Form Name select theShow SubForm Calculations in the Main Form
Form you want to openCan’t do this directly, so need to create control that
Save macro as Autoexecmakes the calculation in the subform (usually in the
Or save a shortcut to the form on the desktopfooter) in properties do two things:
Or use the Startup feature and specify the form hereControl Name – give the control a name
Print the Current Record ButtonVisible property – set to ‘No’
Record Operations | Print RecordAdd a text box to the main form with the following
Disable the rest of the Database whilst in a Formsyntax:
Properties [Other] Modal set to Yes=[subform name].Form![calculation control name]
Change the Tab Order of ElementsAutoTab between Controls with a Set Number of
View | Tab OrderCharacters
Change the Title in the Title BarSet Input Mask property to the number of characters
Properties [Format] Caption propertyallowed
Add a Calculated FieldSet the AutoTab property to yes.
Add a text box and add the calculation based on fields