• توجه: در صورتی که از کاربران قدیمی ایران انجمن هستید و امکان ورود به سایت را ندارید، میتوانید با آیدی altin_admin@ در تلگرام تماس حاصل نمایید.

آموزش کامل Access 2007-EN

A M I R

کاربر ويژه
[h=2]Entering and Editing Data in Tables


[h=5]Using Field Properties to Ensure Data Integrity

Another way to ensure data integrity is by setting field properties such as Field Size, Format, and Required.



  • Field Size can be set to hold a specific number of characters, up to as many as 255 for
  • text fields. If you were using a text field to hold the two letter state postal abbreviation, the
  • field size could be set to 2 to ensure that no one enters a full state name into this field.




  • The Format field property can be set to display text or numbers in a standardized
  • way. For example, text can be set to show as all uppercase and numbers can be
  • set to show scientific numbers, percentages, or decimals.
  • Set the Required property to Yes if you want the person entering data to be required to enter
  • something in the field. Choose No if the person entering data is allowed to leave the field blank.





These are just some ways Access helps you ensure that data being entered into your database is valid.


 

A M I R

کاربر ويژه
[h=2]Entering and Editing Data in Tables



[h=3]Challenge!


If you haven't already done so, save the sample Ready2Read database on your own computer.






  • Open the database, and add records using the new record navigation button


  • Add a record using the New Record command in the Ribbon



  • Edit a record using the Find and Replace command



  • Copy and Paste a record in one of the tables



  • Set a validation rule and validation text for a field in one of your tables. Then, break the rule when entering data and see the resulting message.




 

A M I R

کاربر ويژه
[h=2]Creating and Using Forms


[h=3]Introduction Another way to populate a database is with the use of forms. An Access 2007 form helps the person entering data

know exactly what information to enter. This lesson will address the benefits of using forms with a database. It

will also show you how to set up a basic form for your Access 2007 database, and will show you how the person

entering data will use the form to populate or edit data in the database. You will also learn how to enhance a

basic form with a drop down list
.




ac07_lesson7.gif

 

A M I R

کاربر ويژه
[h=2]Creating and Using Forms


[h=3]Creating and Using Forms
[h=5]Why Use Forms?

In real life, a form is piece of paper that you fill out so that someone can collect and keep track of

specific information about you. Only one record, your record, is captured with any given paper form.


ac07_form.gif



Access 2007 forms work very much the same way.



In previous lessons, you saw that you can populate a database by entering records into the tables themselves. If the

database has hundreds of records and many fields to populate for any given record, a table can be overwhelming to

the person entering data. An Access form lets your user enter data one record at a time, without having to see the entire table.



ac07_book_form.gif



An Access 2007 form also lets the person entering data know exactly what information to enter, and

can even tell him what that information should look like. Adding certain control components to a

form -- like a drop down menu -- can dramatically increase the integrity of the data that is held in a database.




A database owner wants to control the levels of access that other database users have to the data -- because

the fewer people that are interacting with the data, the lower the chance that the data can become

compromised. Corrupt data is not useful! Forms are one more way that the database owner can limit

the actions of the other users
. Form properties can be set so users can only enter records or only view records.







 

A M I R

کاربر ويژه
[h=2]Creating and Using Forms


[h=3]Creating a Form

Access 2007 has several automatic tools for creating forms. These tools are located in the Forms group on the Create tab in the Ribbon, as seen below:


ac07_forms_group.gif


The Access 2007 forms tools include:



  • The Form command makes a basic form, showing a single record at a time.



  • The Split Form command creates a form showing one record on top, and includes the datasheet view of entire source table on the bottom.



  • The Multiple Items command creates a form that shows all the records at once, which looks very similar to the source table in datasheet view.


  • The Form Wizard is hidden under the More Forms command. It walks you through the process of creating more customized forms.




 

A M I R

کاربر ويژه
[h=2]Creating and Using Forms


[h=5]To Create a Form using the Form Command
The basic Form command is the one we suggest, because it allows the person entering data

to see just one record at a time. It also includes all the fields in your source table for you, and

you can modify the layout of the basic form to hide fields or add controls.




To create a form using this command:




  • Begin by highlighting the table you wish to use as a source table.



  • With the source table highlighted, select the Form command from the Forms command group in the Create tab on the Ribbon.


  • The new form is created and opens in the object pane.



The newly created form has the same name as the source table by default. You can give the

form a new name by saving the form. You will be prompted to give the form a name.





 

A M I R

کاربر ويژه
[h=2]Creating and Using Forms


[h=3]Using Forms to Enter Data

Populating a database is easy once you have a basic form in place. Record navigation works the same

way for forms as it did for tables. The Navigation Bar is located in the bottom left of the object

pane. The Navigation Buttons work the same way they did for the tables, also. The following

picture shows the navigation buttons for a form.


ac07_form_nav.gif

Form Navigation Buttons




 

A M I R

کاربر ويژه
[h=2]Creating and Using Forms


[h=5]To Add a Record using a Form

To add a record to the database using a form:



  • Navigate to a new record, either by using the New Record navigation button, or the New command in the Records group on the Ribbon.


  • Then, simply add the new data.

  • Your data must be entered using an acceptable format. The acceptable formats were established when the field properties were set.


Finally, you must save the record.


Save by using either the Save command on the Ribbon, or by progressing to another record

using the New (Blank) Record navigation button. Moving to a new record saves the most

recently entered record. However, it may be necessary to refresh the table in Datasheet View to see the newest record.






 

A M I R

کاربر ويژه
[h=2]Creating and Using Forms


[h=5]To Edit Records using a Form


Just like in a table, the database user can edit records from a form using the Find and

Replace
command. This command works exactly the same way for a form as it does in a table.



 

A M I R

کاربر ويژه
[h=2]Creating and Using Forms


[h=3]Creating a Drop Down List
Using a drop down list on a form can increase the integrity of the data in the database, because

drop down lists force the form user to select one of the pre-set options in the list to populate

the field. These types of form controls are relatively easy to set up using the Combo Box.



 

A M I R

کاربر ويژه
[h=2]Creating and Using Forms



[h=5]To Create a Drop Down List using a Combo Box Control

With the form opened in Design View, select the Combo Box command in the Controls group on the Design tab in the Ribbon


ac07_combobox.gif



  • Drag and drop the Combo Box sizing tool to create the Combo Box where desired on the form.

    ac07_combobox_sizer.gif


  • The Combo Box Wizard appears.
    ac07_combobox_wizard.gif




    • Choose the desired option from the Wizard, and click Next.

    Because the middle option was selected in the example above, the Wizard progresses to the next

    step, which asks for the values to be typed into a small table.



    Combo_Box_Values.png




    Next, the Wizard asks what to do with the entered values. Access can either remember the

    values for later use, or can populate a field with the entered values. Use the drop down list

    to select which field Access should use to store the values.


    ac07_combobox_wizard2.gif



    • Once the desired option has been selected, click Next.

    • Finally, the Wizard gives the Combo Box a generic name, which may be meaningful to you later if there is ever a need to adjust the properties of this or
    • another Combo Box. If you choose, give the Combo Box a name and click Finish.



    Whatever name is entered will appear as a label on the form. This label may be deleted, if desired.


    Switch to Form View to see how the Combo Box works. The Category drop down list appears on our Books form, as seen below.




    ac07_form_categorylist.gif






 

A M I R

کاربر ويژه
[h=2]Creating and Using Forms


[h=3]Challenge!

If you haven't already done so, save the sample Ready2Read database on your own computer.




  • Scroll through the customer records using the Customers form.



  • Create a basic Books form using the Form command.


  • Use the new Books form to enter and save the following data:
    • Title: The Secret Streets of Savannah
      Author: Amy Little
      Category: Travel
      Price: $34.99
    • Title: Cars and Trucks
      Author: Jonathon Bradley
      Category: Kids
      Price: $14.99





Using the Combo Box command, create a drop down list on the Books form for the following Categories:


  • Fiction
  • Non-Fiction
  • Kids
  • History
  • Technology
  • Home & Garden
  • Travel
  • Food



  • Add another record to the database using the Books form with the drop down Category selector.


  • Use the Find and Replace command to change the price of all books that are $14.99 to be $16.99.




 

A M I R

کاربر ويژه
[h=2]Making Forms More Usable with Controls


[h=3]Introduction You have already seen how a Combo Box control can make a form more user-friendly. In Access 2007, there are several

other ways you can modify forms to make them easier to use and, at the same time, increase the integrity of the

database. This lesson will explain how to use form properties to limit the actions your form user can take. It will

also walk you through hiding fields on a form and adding command buttons to the form.




ac07_lesson8.gif

 

A M I R

کاربر ويژه
[h=2]Making Forms More Usable with Controls


[h=3]Making Forms More Usable

[h=5]Making Forms More Usable
You already know that forms can help you increase the integrity of your data by limiting

what your user can see and how they can enter data. You saw that using a drop down list

can make data entry easy. Now it is time to think about the design of your forms from your form user's perspective.



Let's look at the Orders form in our bookstore scenario. The basic form, which was created with the Form command, looks like this:


ac07_ordersform.gif




This form is where we would want our user, the store employee, to pair a customer with

a book to complete an order. Let's look at this form from our user's point of view:


Our employee would be adding new orders, not editing existing ones. We will set form properties to limit this action.

The user will also never need to enter the Order ID number, as this is the number that the database

assigns each order record to differentiate it from other orders. We will hide this field.



The Customer ID field and the Book ID field are not very useful as they are, because our employee

would have to know each customer's ID number and every Book ID number to be able to enter the

data in the format we need. We will make these fields more usable by creating Combo Boxes

that help our user select the correct customer and book.


Our user will not need to enter the Order Date, because we want the database to auto-populate this

field in the database using today's date. We will set field properties to make this happen.


 

A M I R

کاربر ويژه
[h=2]Making Forms More Usable with Controls


[h=5]Setting Form Properties
Access 2007 allows you to set many form properties. Form properties are options

that are set in Design View on the Property Sheet, like the one shown below. These

options control how the form looks, works, and interacts with the rest of the database.


ac07_property_sheet.gif



 

A M I R

کاربر ويژه
[h=2]Making Forms More Usable with Controls


[h=5]To Set Form Properties
To set properties for your form:



  • View the form in Design View.


  • Select the Property Sheet command from the Tools group on the Ribbon, as seen above.



  • Note: The form Property Sheet is also accessible by right clicking anywhere on the form in Design View and selecting Properties from the menu.


    When the property sheet opens:


    • Make sure Form is selected in the Selection type drop down list
    • Set the desired form properties.


    ac07_property_sheet1.gif



    Tip: Use the tabs to find the specific property you wish to set. Use the help that Microsoft

    Access 2007 offers you in the bottom left corner of the Access window to know what each property setting does.




 

A M I R

کاربر ويژه
[h=2]Making Forms More Usable with Controls


[h=5]Hiding Fields on a Form
There will be times when a field will not be needed on a form. Access 2007 allows you

to hide fields by setting the Visible field property in Design View.





 

A M I R

کاربر ويژه
[h=2]Making Forms More Usable with Controls


[h=5]To Hide a Field on a Form
Hiding a field makes it invisible on the form when it is viewed in Form View. To hide a field:

In Design View, open the Property Sheet.

Change the Visible property setting to No, as seen below:

ac07_visible_property.gif




  • Switch to Form View to verify that the field is hidden.




 

A M I R

کاربر ويژه
[h=2]Making Forms More Usable with Controls


[h=5]Creating Combo Boxes




For the New Orders form in our bookstore example, we created user-friendly drop

down lists using the Combo Box command. These drop down lists help our user

identify a specific customer and a specific book using more useful information

than the Customer ID and Book ID numbers, as seen below:




ac07_neworders_form.gif








 

A M I R

کاربر ويژه
[h=2]Making Forms More Usable with Controls


[h=5]Setting Field Properties

Sometimes, it may be necessary to set field properties from the form itself. For example, on the New

Orders form for our book store shown below, we want to set up the Order Date field to auto-fill with

the current date each time an order is entered. This way, our employee will not have to worry about

entering a date on the form, because the form will do it for him.



ac07_field_property.gif





 
بالا