+ All Categories
Home > Documents > DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation...

DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation...

Date post: 30-Jun-2020
Category:
Upload: others
View: 3 times
Download: 0 times
Share this document with a friend
55
DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) Database Program: Microsoft Access Series Instructor: Michael Kremer, Ph.D. Technology & Information Management Section 5
Transcript
Page 1: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

DEVELOPING DATABASE APPLICATIONS

(INTERMEDIATE MICROSOFT ACCESS, X405.5)

Database Program: Microsoft Access Series

Instructor: Michael Kremer, Ph.D.Technology & Information Management

Section 5

Page 2: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

AGENDA

16. Creating/Customizing Forms

17. Form Properties

18. Basic Form Controls

Page 3: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

Creating/Customizing Forms

16.

Page 4: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

16.1 OVERVIEW OF FORMS

Forms are the primary tool to connect the data from the

database with us humans.

Utilize UI tools to connect data in certain ways to make them

more meaningful to us.

A well-designed form uses appropriate controls for certain data

types, colors and lines to indicate proper workflow or directions,

and sub forms to include one-to-many relationships in one form.

Since form (and report) objects do not change daily (once a

system is in production), they should not be stored on a file

server for user access.

Create a form in design view, only detail section is initially

shown.

Notice the grid of dots. This grid can be turned off.

199

Page 5: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

16.1 OVERVIEW OF FORMS

Arrange tab Sizing & Ordering group, Size/Space Grid

Grid is used for aligning objects on a form.

To change the grid dot distance:

Property sheet for Form Format tab: Grid X, Grid Y properties.

To use the grid points effectively, turn on the Snap to Grid menu

selection in the Form Design Tools contextual ribbon, Arrange

tab, Sizing & Ordering drop down list.

When this option is turned on, objects are aligned with the

nearest grid point at the upper left corner of the object.

Also moving and resizing will

align objects accordingly to the

nearest grid point.

200

Page 6: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

16.1 OVERVIEW OF FORMS

Each form can have up to five different sections, designated

elements of the form design.

The five sections are:

Form Header

Pager Header

Detail Section

Page Footer

Form Footer

201

Page 7: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

16.1 OVERVIEW OF FORMS

To turn on or off these sections, right-click in the form to display

the short-cut menu.

Then click on the Form and Page

Header/Footer icons in the

short-cut menu again.

To size these sections, hover your

mouse over the edges of the

horizontal bars of the sections,

click and hold the mouse and

drag it up or down.

202

Page 8: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

16.1 OVERVIEW OF FORMS

Form Header:

Displays a title for the form, instructions for using it, and command buttons that open related forms or carry out other tasks.

Page Header:

Displays information such as a title, column headings, or any other information which is useful only when the form is printed.

Details Section:

This section is for the actual database data. Depending on the form design, it can display one record at a time or multiple records.

Page Footer:

Again, the page footer is used only for printing purposes.

Form Footer:

The form footer can be used for the same items in a form header, such as displaying information or instructions, command buttons, etc. However, the form footer is also used for displaying summary information.

203

Page 9: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

16.1 OVERVIEW OF FORMS

204

Page 10: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

16.1 OVERVIEW OF FORMS

Page Header/Footer and Form

Header/Footer can only be added

or removed as a pair. If only a page header is needed, but not a

footer, simply resize the footer section to height 0.

To display section properties,

simply double-click on the

corresponding horizontal

section band, double-click

inside the section, or right-click

on the horizontal bar or inside

the section.

Note the properties window displays a selection type, such as

Section, then the drop-down box below lists the selected section,

such as FormHeader, FormFooter, etc.

205

Page 11: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

16.2 FORM DESIGN TOOLS

Property sheet is

a major tool to

set properties of forms and controls.

To display the property sheet, click the property sheet button in

the Design tab of the contextual Form Design Tools ribbon.

Or simply double click almost anywhere in the form, and the

property sheet is displayed for the double-clicked object.

The header section of the property sheet

dialog box carries the name of object for

which the properties are displayed.

206

Page 12: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

16.2 FORM DESIGN TOOLS

Remember, there are overall form properties, then section

properties, and within each section there are control properties.

Each property dialog box is divided into five tabs:

Format: Properties to change the appearance of an object, such as color,

style, size, special effects, and some other properties.

Data: Properties to change data specific properties or methods, such as

read only, data source, filters, record locks, etc.

Event: Properties to change behavior of objects when a specific event

occurs. For example, clicking a command button is an event, setting the

property for this event could open a related form when button is clicked.

Other: All other properties which do not fit into any of the preceding

categories. For example, tab stops for a form, the name of the control,

linking a control to a help file, etc.

All: This tab shows all properties from the preceding four categories in one

view, sorted alphabetically.

207

Page 13: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

16.2 FORM DESIGN TOOLS

Another tool are the rulers, at the

top and to the left of the form

design window.

The form design tab has also

some important buttons, mostly

located to the right.

The most important tool

is probably the Controls section.

The Controls Section contains buttons to create controls on a

form. Basically, simply click a desired control, and then drag an

area on the form where the control is to be placed.

208

Controls Section PropertiesField List

Code/VBA

Page 14: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

16.2 FORM DESIGN TOOLS

Pointer: The pointer is used to select objects and

is turned on by default. If a control is selected

inadvertently, then click the pointer button to

deselect the control. If a control is selected and

placed on a form, the pointer button is turned on again.

Control Wizards: If this button is turned on, then for certain

controls a wizard will be launched. If it is turned off, the control

will be placed on the form without the wizard.

ActiveX: Another special button is the ActiveX control button,

which displays all registered ActiveX controls in a separate

window.

209

Page 15: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

16.2 FORM DESIGN TOOLS

The field list comes in three flavors:

Display only data source form is bound (linked) to.

Display data source form is bound (linked) and related tables (based on

relationships)

Display all tables in the current database if form is unbound

Using the field list you can drag fields onto the form’s designer

surface to immediately create form controls.

When a form is bound to a

data source, then you see

only fields contained in

that data source.

When a form is unbound, meaning not based on any data, the

field list shows all tables in the current database by default.

210

Page 16: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

Form Properties

17.

Page 17: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.1 FORM FORMAT PROPERTIES

The form’s format properties mainly determine the form’s

appearance and the specific form window features.

To access the form properties, display the property sheet and

select the form by clicking on the square at the intersection of

both rulers in form design.

211

Page 18: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.1 FORM FORMAT PROPERTIES

Caption Property:

The form title bar displays the form object name in form view if left blank.

The caption property allows the user to provide a new form title. In form

design view, you will always see the form’s name in the windows title bar.

Default View:

This property determines

which view is displayed

when the form is first

opened (Default View).

212

Page 19: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.1 FORM FORMAT PROPERTIES

213

Default View

There are five different properties for views allowed:

Allow Form, Datasheet, Pivot (Table, Chart), Layout View

The Views allowed affect the short-cut menu when you are in

the default form view and you want to switch to a different view.

The Allowed Views allows you to control between which

different types of form views the user can switch.

Page 20: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.1 FORM FORMAT PROPERTIES

View Allowed effecton shortcut menus.

Properties relating tobackground picture fora form.

Picture Type:

Embedded, Linked, Shared

Picture:

The actual graphic file or the file path to the picture stored on disk.

Picture Tiling:

Yes/No, whether a picture is tiled within the form object or not.

Picture Alignment

Top Left, Top Right, Center, Bottom Left, Bottom Right, Form Center.

Picture Size Mode

Clip, Stretch, Zoom, Stretch Horizontal, Stretch Vertical

214

Page 21: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.1 FORM FORMAT PROPERTIES

215

Page 22: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.1 FORM FORMAT PROPERTIES

Width(Inches)

The width of the form design surface, not the window itself. When you size the form design surface, this property setting is automatically set.

Auto Center, Auto Resize (Yes/No)

Auto resize will open a form and sizes its window to display a complete record. If turned off, the last saved form size will be used. Auto center will automatically center a form within the application window.

Fit To Screen (Yes/No)

To reduce the form size to fit the screen

BorderStyle (None, Thin,Sizable, Dialog)

To specify a border style forthe form.

Only sizable allows user to size the form in form view.

216

Page 23: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.1 FORM FORMAT PROPERTIES

Record Selectors (Yes/No)

Displays important status informationvisually, such as unsaved data, saved data, active record, and locked record.

Navigation Buttons(Yes/No)

To turn on or off the record navigation buttons at the bottom of a form.

Navigation Caption

To replace the caption “Record” in the Navigation Bar with a custom caption.

Dividing Lines(Yes/No)

To turn on/off lines separating form sections or records on a continuous form.

Scrollbars(Neither, Horizontal only, Vertical only, Both)

Whether to display scrollbars on a form, and this strongly depends on other form properties. For example, if a continuous form is created, at least vertical scroll bars should be present to allow the user to navigate between records.

217

Page 24: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.1 FORM FORMAT PROPERTIES

Control Box (Yes/No)

Setting the control box to no

removes the form window control

box, but also removes the Min/Max

and Close button.

Close Button (Yes/No)

The close button can be turned on

or off, when it is off, it remains visible on the form but disabled.

Min Max Buttons (None, Min Enabled, Max Enabled, Both

Enabled)

Removes the minimize and/or maximize buttons depending on the

settings. When set to None, the minimize and maximize buttons are not

visible, but the close button still is.

218

Page 25: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.1 FORM FORMAT PROPERTIES

Moveable (Yes/No)

Whether form can be moved by dragging the title bar with the mouse.

Split Form Size

The size of the Form(not datasheet) portion in a Split form.

Split Form Orientation (Datasheet on Top,.. Left,.. Bottom,.. Right)

To define whether datasheet appears above, below, left, right of the form.

Split Form Datasheet (Allow Edits, Read Only)

When set to Allow Edits, Access allows edits to be made on the datasheet.

Split Form Printing (Form Only, Datasheet Only)

When Form Only only the form portion is printed, otherwise datasheet.

Save Splitter Bar Position (Yes/No)

Form opens with the splitter bar in the same position of last state.

Subdatasheet Expanded (Yes/No), Subdatasheet Height

219

Page 26: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.1 FORM FORMAT PROPERTIES

Grid X, Grid Y (0-60)

To specify the density of grid points

in form design view. This is useful

for developer, not for the end-user.

Layout for Print (Yes/No)

You can use the LayoutForPrint

property to specify whether the form uses printer or screen fonts.

Note: Screen fonts are installed on your system, printer fonts when you

install printer drivers. Screen and print fonts can differ.

Orientation (Left-to-Right, Right-to-Left)

Whether form elements are displayed from Left-to-Right or Right-to-Left.

Palette Source

To set a different color palette for images.

220

Page 27: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.2 FORM DATA PROPERTIES

The form’s data properties are an

important aspect of the overall form

behavior.

To set a form to read-only,

data entry form, specifying filtering and

sorting, and the actual data source.

Record Source

To bind or link data to the form. The data can be in form of a table, query,

or a SQL statement directly entered into this property. Based on this data

source, fields can be placed on the form from that data source.

Simply click in the Recordsource property and select a table or

query from the drop-down list.

221

Page 28: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.2 FORM DATA PROPERTIES

To create a SQL statement, click on the Build button to the right.

If a table or query is already selected, then a SQL statement will

be initiated using that table or query.

A message box is displayed:

Common query interface is displayed.

Build query, then either save as individual query or close the

query designer to save the SQL statement as RecordSource

property.

Recordset Type

(Dynaset, Dynaset(Inconsistent Updates), Snapshot)

A dynaset is a dynamic subset of table data.

A dynaset allows updates to be made to the underlying

data source whereas a snapshot is read-only.

222

Page 29: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.2 FORM DATA PROPERTIES

Fetch Defaults (Yes/No)

If set to yes then default

values in fields are shown

when adding a new record

even before a new record is

added.

If no, then the default values

are displayed only once a

new record is being added.

Filter

You can use the Filter

property to specify a subset of records to be displayed when a filter is

applied to a form.

The filter property is basically a SQL Where clause (fieldname = value).

When you view the form, the filter is not applied until you click the Toggle

Filter(Apply Filter) button in the Home tab in the Sort & Filter group.

223

Page 30: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.2 FORM DATA PROPERTIES

Filter on Load(Yes/No)

When set to Yes, a specified filter in the filter property is automatically applied when the form is loaded. If set to No, then the user has to click the Toggle Filter button to apply the filter.

Order By

The Order by property consists of the Order by part of a SQL statement. Use Desc after the field name to sort in descending order.

Order By On Load(Yes/No)

When set to Yes, the Order By property settings will be applied when the form is loaded.

Wait For Processing

The default setting is No. Choosing Yes tells Access to wait for the data macro to finish processing before returning control back to the user.

Data Entry (Yes/No)

You can use the DataEntry property to specify whether a bound form opens to allow data entry only.

224

Page 31: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.2 FORM DATA PROPERTIES

225

Page 32: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.2 FORM DATA PROPERTIES

Allow Additions If this property is set to no, only existing records can be updated or deleted,

but no new records can be entered.

Allow Deletions If this property is set to yes, the user is not able to delete any records.

However, editing and/or adding records is still possible.

Allow Edits When the Allow Edits property is set to no, the user cannot make any

modifications to existing records. However, the user would still be able to add new records or delete existing records. If a read-only form is desired, then set also Allow Deletions and Allow Additions to no.

Allow Filters If Allow Filters is set to yes, then the Filter property can be specified. If set to

No, no filtering is enabled when the form is viewed in Form view. The filtering options in the Home tab, Sort & Filter group as well as the shortcut menus on the form are either disabled or removed.

Record Locks This property setting is important when the database is set up for multi-user

access and two or more users are editing the same record. MS Access allows for true record-level locking mechanism.

226

Page 33: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.2 FORM DATA PROPERTIES

There are three record locking modes:

No Locks (Optimistic Locking, assuming no or very few concurrency

issues)

All Records (Pessimistic Locking, locking all records)

Edited Record (Record-Level locking)

No Locks (Optimistic Locking)

This is the default setting, also called optimistic locking. Two or

more users can edit the same record simultaneously. If there is

a write conflict, three choices are offered to the user.

Save Record

Copy to Clipboard

Drop Changes

227

Page 34: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.2 FORM DATA PROPERTIES

228

Page 35: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.2 FORM DATA PROPERTIES

All Records (Pessimistic Locking)

All records in the underlying table

or tables are locked. No other user

can make changes to any records

in the tables affected, also called

pessimistic locking.

Edited Record (Record-Level Locking)

An actual record is locked. All other

records are not locked and can be

used by other users for editing.

If a record is being locked, and the form used contains a record

selector, a locking symbol is displayed to indicate a locked

record.

229

Page 36: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.2 FORM DATA PROPERTIES

Record Lock symbol in record

selector bar.

Access Options: Set record locking default behavior.

230

Page 37: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.3 FORM EVENT PROPERTIES

The events tab contains many properties, the so-called event

properties. One can create code or a macro and set it to one of

these event properties. When an event is fired, the code or

macro gets executed.

Events are entering and exiting a control for example, of

changing of data, or using the mouse or the keyboard. The user

can interact by using these events and trigger an operation, such

as a validation for the entire form.

231

Page 38: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.4 FORM OTHER PROPERTIES

The properties in the Other tab of the properties sheet are miscellaneous properties that do not fit into any of the first 3 categories.

Pop-Up (Yes/No)

Setting a form to pop-up makes the form window float on top of all other windows.

Modal (Yes/No)

If modal is set to yes, all other window elements become inaccessible until the form is closed. This is useful if an operation on a form must be performed before moving on.

Pop-Up form: A form which stays on top of other windows. The Borderstyle should be set to thin. Useful to enter additional information, opened from the main form.

Dialog-box: The Pop-Up and the modal property is set to yes, and the BorderStyle is Dialog. Useful to enter criteria information for running reports.

232

Page 39: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

17.4 FORM OTHER PROPERTIES

Cycle (All Records, Current Record, Current Page) Cycle property determines what should happen if the focus is on the last

control and the user presses [tab] or [Enter] to move to the next control. All Records: Focus is moved to first control of next record. (Implicit Save!)

Current Record: Focus is moved to first control of current record.

Current Page: Only applies to multi-page forms, moves focus to first control of current page.

Ribbon Name To attach a custom ribbon that will be displayed when the form is opened.

Menu Bar, Toolbar, Shortcut Menu, Shortcut Menu Bar To link customized menu bars, toolbars and shortcut menus to a form.

Help File, Help ContextID To link a help file and a specific topic to a form.

Has Module Whether a form has a module containing code, if set No, code will be deleted.

Use Default Paper Size(Yes/No): Use default paper size

Fast Laser Printing(Yes/No): Replace lines and rectangles by text character lines.

Tag: Store additional information about the object.

233

Page 40: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

Basic Form Controls

18.

Page 41: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

18.1 SELECTING CONTROLS

One has to be careful about using the mouse, the [Shift] and

[Ctrl] keys, and the arrow keys when dealing with controls.

When a control is selected, many handles (little squares) are

displayed around the perimeter of the control. An orange-colored

frame is placed around the selected control.

To select a control, click anywhere inside the borders of control

without moving the mouse. Clicking once again enables editing

the default property

in that control.

234

Page 42: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

18.1 SELECTING CONTROLS

When one of these controls is selected, the attached label is

also selected in that it

moves with the control.

When selecting a control, the border lines of a control contain

sizing handles and the upper left hand corner contains a move

handle.

When the label is selected, the label control contains all sizing

handles and one move handle, and the associated control

contains one move handle.

Placing the mouse pointer over a move handle displays a four-

headed arrow pointer, and

locating the mouse pointer over

a sizing handle shows a

double-opposite arrow pointer.

235

Page 43: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

18.1 SELECTING CONTROLS

Different control selection methods are listed below:

Single control selection method:

Simply click once on the control. The move and sizing handles are displayed.

Multiple controls selection method using [Shift] or [Ctrl] key:

Click on the first control, then hold down the [Shift] or [Ctrl] key and select the next

control.

Rectangle selection method:

Click in the upper left hand corner outside

a control, hold the mouse, and draw a

rectangle over all controls to be selected.

Then release the mouse button, and all

controls falling into the rectangle are

selected.

Ruler selection method

When the mouse is placed into the ruler area, the mouse pointer shape is changing to a

horizontal arrow (in the vertical ruler) or to a vertical arrow (in the horizontal ruler).

Clicking the mouse in that position draws a line (either vertical or horizontal) through

the entire form or report. Any controls hit by the line are selected

236

Page 44: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

18.1 SELECTING CONTROLS

Single-click ruler selection:

Dragging ruler selection:

237

Page 45: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

18.1 SELECTING CONTROLS

Selecting all Controls

To select all controls, press [Ctrl] + A on your keyboard.

To group multiple controls together, select the controls, then

choose the Arrange tab in the Form Design Tools contextual

Ribbon, then click on the Size & Space drop down button in the

Sizing & Ordering group.

This grouping applies only to

moving and sizing behavior, the

controls remain individual in

terms of properties.

When selecting any of the

grouped controls, then all

controls are selected.

238

Page 46: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

18.2 MOVING CONTROLS

To move a control, simply select a control and then move the mouse pointer over to control until the four-headed arrow is displayed as the mouse pointer. Click and hold the mouse button and drag the control to its desired location. When the location is reached, simply release the mouse button.

If a compound control is moved, its associated label is moved as well.

To cancel a move or a size operation, press the [Esc] key before releasing the mouse. To cancel a move or a size operation after the mouse is released, choose undo if available.

If multiple controls are selected, place the mouse pointer over the group of controls until the four-headed arrow mouse pointer appears. Then click the mouse button and move the entire group of controls to its desired location.

239

Page 47: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

18.2 MOVING CONTROLS

Moving controls can also be achieved by using the keyboard. In

fact, movements can be accomplished in much smaller

increments.

Select a control, then either use the arrow keys alone or hold the

[Ctrl] key, then use the arrow keys to move a control. Using the

[Ctrl] key moves the control by a pixel, without the [Ctrl] key by a

grid point.

To move an attached label

separately from its control, do

the following:

Hold down the shift key to achieve horizontally or vertically

bound moving (Depending on whether the very first mouse

movement is horizontally or vertically).

240

Page 48: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

18.2 MOVING CONTROLS

A control can also be moved using its

Left and Top properties.

The left property is measured in inches

from the left side of the form, and the

top property from the top of the form.

241

Page 49: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

18.3 SIZING CONTROLS

To size a control, select a control with the mouse, and use one of the following size handles:

To size a control only in one direction,use the side handles, either the horizontal or vertical sides.

Place the mouse over the size handle, the mouse pointer shape changes to a double-arrow, click the mouse, hold and drag to the desired size.

To size a control in both directions simultaneously, use the corner handles. Place the mouse pointer over one of the corner handles, the mouse pointer shape changes to a double-arrow, click the mouse, hold and drag to the desired size.

Sizing a control can also be achieved by using the keyboard. Select the control, then hold down the [Shift] key and use the appropriate arrow key on the keyboard.

242

Page 50: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

18.3 SIZING CONTROLS

To size a control to the grid, follow these steps:

1. Select the control with the mouse.

2. Navigate to Arrange tab in the Forms Design Tools ribbon, in the Sizing &

Ordering group, click on drop-down Size/Space, then click on To Grid.

3. MS Access resizes the control so that the corners snap to the grid.

Use the Width and Height property of

the property sheet of a control and

enter the exact size.

Sizing controls relative to each other.

Arrange tab, Sizing & Ordering, Size/Space To Tallest: Sizes the selected controls to the tallest one.

To Shortest: Sizes the selected controls to the shortest one.

To Widest: Sizes the selected controls to the widest one.

To Narrowest: Sizes the selected controls to the narrowest one.

243

Page 51: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

18.3 SIZING CONTROLS

Sizing controls relative to each

other requires at least two

controls to be selected.

The 4 options are grayed out if

only one control is selected.

However, To Fit and To Grid are

enabled if one control is selected.

The To Fit option sizes a control only vertically (height) to make

the text fit inside the control including margins and padding.

The To Grid option moves a control to the nearest grid point.

244

Page 52: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

18.4 COPYING AND DELETING CONTROLS

To copy a control, either use copy in the Home tab (Or [Crtl] +

[C]) and then paste (or [Ctrl] + V).

Customize Quick Access toolbar to add Duplicate Control button.

To apply only formatting from one control to another, follow these

steps:

1. Select the control with the desired formatting to be copied.

2. Click the Format painter button in the Home tab.

3. Note the mouse pointer shape changes to a point brush

4. Click the control to copy the format.

245

Page 53: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

18.4 COPYING AND DELETING CONTROLS

A Control can be moved into other sections of a form or report. To move label separately from control into a different section:

1. Select the label control.

2. Select in the Home tab, Cut, or key strokes ([Ctrl] + [X])

3. Select the section where the label control is to be copied.

4. Choose Home ribbon Edit, Paste or key strokes ([Ctrl] + [V]).

To separate compound controls, follow these steps:

1. Select the label of the compound control.

2. Choose Cut in the Home ribbon or key strokes ([Ctrl] + [X])

3. Choose Paste in the Home tab, Paste or key strokes ([Ctrl] + [V])

To re-attach a label back to a control, follow these steps:

1. Select the label.

2. Choose Cut in the Home tab or key strokes ([Ctrl] + [X])

3. Select the control to which the label is to attached.

4. Choose Paste in the Home tab or key strokes ([Ctrl] + [V])

246

Page 54: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

18.5 ALIGNING CONTROLS

To align controls to each other use the following simple tools:

Ruler

Grid

Snap To Grid

To make fine adjustments to location or size of a control:

[Ctrl] + arrow keys: To move a control or group of controls in all four directions.

[Shift] + arrow keys: To size a control or group of controls in all four directions.

Aligning controls:

1. Select at least two controls to be aligned with each other.

2. Select the Arrange tab, Sizing & Ordering group, drop-down Align.

3. There are four options available: Left: Controls will be left aligned to the leftmost control.

Right: Controls will be left aligned to the rightmost control.

Top: Controls will be left aligned to the highest control.

Bottom: Controls will be left aligned to the lowest control.

247

Page 55: DEVELOPING DATABASE APPLICATIONS (INTERMEDIATE MICROSOFT ACCESS, X405.5) › ... › PPPresentation › PPIntAccessClass5.pdf · 2016-03-20 · 16.1 OVERVIEW OF FORMS Forms are the

18.5 ALIGNING CONTROLS

To space controls evenly, follow these steps:

1. Select the controls to be spaced evenly.

2. Choose Format Design Tools ribbon, then Arrange tab, Sizing & Ordering,

Size/Space drop down.

3. Choose Equal Horizontal or Equal Vertical.

To increase or decrease the space between

controls, follow these steps. MS Access increases

or decreases the spacing by one grid point.

1. Select at least two controls.

2. Format Design Tools ribbon, then Arrange tab, Sizing & Ordering group,

Size/Space drop-down.

3. Choose Increase or Decrease (Horizontal or Vertical).

248


Recommended