جاوا اسکریپت غیر فعال است برای تجربه بهتر، قبل از ادامه، جاوا اسکریپت را در مرورگر خود فعال کنید.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser .
آموزش کامل Access 2007-EN
[h=2]Making Forms More Usable with Controls
[h=5]To Set Field Properties from a Form
To set a field property for a form, in Design View:
Highlight the appropriate field on the form.
Verify that the Field Name appears in the Selection type drop down list.
Set the desired field property.
In our example, we want to set the
Order Date field to auto-fill with the current date. Refer to the
picture below. Notice that we have the
Order Date field highlighted on the form itself. On the
Property Sheet, we have
Order Date showing in the
Selection type drop down list.
Because we want the
Order Date to auto-fill, we have to set the default value to always enter the current date.
[h=2]Making Forms More Usable with Controls
[h=5]To Set a Field to Auto-fill with the Current Date
To set the
Order Date field to automatically enter the current date in our database:
Open the Data tab on the field's Property Sheet .
Set the Default Value property by clicking on the Expression Builder button.
Use the Expression Builder to enter the expression for the current date. It looks like this:
The Expression Builder contains many commonly used expressions for database functions. Explore them by clicking on the various files in the left hand column.
[h=2]Making Forms More Usable with Controls
[h=5]Creating Command Buttons
Another way to make a form more user-friendly is by adding
command buttons to the form. Command
buttons are a quick way for your form user to take a specific action. These command buttons are grouped
into categories of actions, including:
Record Navigation command buttons -- easily allow your user move among the records in your database.
Record Operation command buttons -- let your user do things like save or print a record.
Form Operation command buttons -- give your user the ability to quickly open or close a form, print the current form, and other actions
Report Operation command buttons -- offer the user a quick way to do things such as preview or mail a report
[h=2]Making Forms More Usable with Controls
[h=5]To Add a Command Button to a Form
To add a command button to a form:
Click the
Button command in the
Controls group on the Ribbon.
When the Command Button Wizard opens:
Select the type of command you want from the Categories list.
Select the specific action you want the command button to perform from the Actions list.
In the next
Wizard step:
If you want text to appear on the button, enter it in the Text box.
If you want a picture to appear on the button, select one using the Browse button.
In the next
Wizard step:
Give the button a meaningful name.
Access will give your button a default name. Renaming it with a more useful name may help later
if you have several buttons on a form and wish to change the properties of one.
The command button should be operational and appear on the form in Form View.
[h=2]Making Forms More Usable with Controls
[h=3]Challenge!
If you haven't already done so, save the
sample Ready2Read database on your own computer.
Open the Orders Form and change the form properties so that it limits the user to adding records only.
Hide the Order ID and Order Date fields.
Set the Order Date field property to have a Default Value of the current date.
Create drop down lists for the Customer ID and Book ID field, making sure they contain helpful
information for your user and correctly populate the database with the ID numbers.
Add a command button to the form.
[h=2]Making Forms Attractive
[h=3]Introduction Now that you know how to make forms work better for your user, it is time to think about what a form looks like. This lesson will
address the various ways to modify a form layout, including how to
add a logo and
apply an Auto Format to the form. It will
also cover
using and formatting titles , as well as
moving and applying borders to objects .
[h=2]Making Forms Attractive
[h=3]Making Forms More Attractive
[h=5]Making Forms More Attractive
Since other people will be using the forms in your database to enter data, you may want to make the forms
more visually appealing. These types of changes are done to the form in Layout View .
In Layout view, you see the form as it will appear to the user in Form View, so it very useful for
setting the size of controls and other objects on the form, and for changing the font, colors, and borders on the form.
[h=2]Making Forms Attractive
[h=5]To Switch to Layout View
There are three different ways to open the form in Layout View:
Right click on the form tab or on the form name in the object list. Then, select Layout View from the list.
Select Layout View in the Views group on the Ribbon.
Click on the Layout View icon in the bottom right hand corner of the Access 2007 window.
[h=2]Making Forms Attractive
[h=3]Adding a Logo
Microsoft Access 2007 automatically puts a form icon, like the one below, in the header area of every form that you create.
One way to customize the look of your forms is to remove that icon and replace it with a
logo. This is very easy to do using the
Logo command.
[h=2]Making Forms Attractive
[h=5]To Replace the Icon with a Logo
To replace the form icon with a logo of your choice:
Select the Logo command from the Controls group on the Ribbon.
Use the Insert Picture dialog box to locate the picture file you wish to use as the logo. Then, click Ok . The new logo should appear.
You can move and re-size the logo, as well. Moving and re-sizing objects on a form is covered later in this lesson.
[h=2]Making Forms Attractive
[h=3]Applying a Style with AutoFormat
Another simple way to dramatically change the way your form looks is to apply a style with the
AutoFormat command. You could modify the color for each part of the form on your own, but
Microsoft Access has already combined colors in several attractive styles. These styles are
available under the AutoFormat command.
[h=2]Making Forms Attractive
[h=5]To Apply an AutoFormat
To apply a pre-set format to the form:
Click on the AutoFormat command on the Ribbon.
Select the desired format. The change will appear when the mouse button is released.
[h=2]Making Forms Attractive
[h=3]Working with Titles
One of the easiest things to change on the form is the title , which
appears in the form header with the icon or logo.
[h=2]Making Forms Attractive
[h=5]To Change the Form Title
To change the form title:
Click the
Title command in the
Controls group on the Ribbon.
When the title highlight appears, type the new title and hit the enter key on your keyboard.
Note : The title does not affect the name of the form and vice versa.
[h=2]Making Forms Attractive
[h=3]Changing Text on the Form
Access, like all Microsoft Office 2007 products, allows you to change the font style, text size, text
color and alignment. It also lets you apply bold, italics, or underlines to the text. All of this is
done from the Ribbon, as seen in the following diagram.
[h=2]Making Forms Attractive
To make changes to the format of the text on a form:
Apply the desired format by doing one or more of the following:
Select the desired font style from the Font face drop down list.
Set the size of the text using the Font size selection list.
Choose a color for the text using the Font color selector.
Apply either the bold , italics , or underline style.
Additional text formatting options are available in the
Font group. The above list includes the most common text modifications.
[h=2]Making Forms Attractive
[h=3]Working with Objects on a Form
Other ways to modify the way a form looks in Access 2007 include re-sizing and re-positioning
the objects that appear on the form, as well as applying borders to objects on the form. All
of these tasks are easily done in Layout View.
[h=2]Making Forms Attractive
[h=5]To Move Objects on a Form
To move an object to another place on the form:
Highlight the object by clicking on it.
Move the object by dragging and dropping it in a new location.
[h=2]Making Forms Attractive
[h=5]To Re-size Objects on a Form
To change the size of any object on the form:
Highlight the object by clicking on it.
When the cross hair cursor appears, hold down the left mouse button and drag the edge to the preferred size.
Release the mouse button to apply the change.
[h=2]Making Forms Attractive
[h=5]To Apply a Border to Objects on a Form
Borders can make an object more visible to your form user. To apply a border to any object on a form:
Highlight the object by clicking on it.
Select a width using the Line Width command.
Select a style using the Line Style command.
Select a color using the Line Color command.
Border Commands