Home

An Order Entry Form

Introduction

If you create a regular form, every time the user opens it, it starts by displaying the first record. On most order entry databases, you may want the user to jump straight to an empty record to perform a new order. Microsoft Access provides various solutions to this problem. With most of them, you don't have to write a single line of code.

Practical Learning: Creating an Order Entry Form

  1. Start a new database named People
  2. In Design View, create a table with the following fields:
     
    Field Name Data Type Additional Properties
    GenderID AutoNumber Primary Key
    Caption: Gender ID
    Gender Text Field Size: 10
  3. Save the table as Genders and switch it to Datasheet View
  4. Set the first gender to Female and the second to Male
  5. Close the table
  6. Create another table in Design View with the following fields:
     
    Field Name Data Type Additional Properties
    PersonID AutoNumber Primary Key
    Caption: Person ID
    FirstName Text Field Size: 20
    Caption: First Name
    LastName Text Field Size: 20
    Caption: Last Name
    GenderID Number Field Size: Long Number
    Caption: Gender
  7. Save the table as Persons and switch it to Datasheet View
  8. Set the records with some values:
     
    Person ID First Name Last Name Gender
    1 Helene Watts 1
    2 Alfred Baugh 2
    3 Mauricette Kouma 1
  9. Close the table
  10. Use AutoForm to create a form based on the Persons table and switch the form to Design View
  11. Delete the GenderID text box (and its accompanying label)
  12. With the Control Wizard button down in the Toolbox, use the Combo Box button Combo Box to start the Combo Box Wizard using the Genders table as the source of data, selecting the Gender field and storing it in the GenderID field. Set the label of the combo box to Gender and click Finish
  13. Save the form as Persons and design it as you see fit:
     
    Persons
  14. Save the form and close it

An Order Entry Form

To create a new record, the user can just click the New Record button New Record. You can also use the Command Button Wizard to create a button that would make this obvious to the user.

An effective solution in creating an order entry form consists of making it separate from the main form that displays all records of the parent table. To do this, you can simply set the Data Entry property of the form to Yes. There are some other cosmetic actions you can take to make your order entry form more efficient.

Practical Learning: Creating an Order Entry Form

  1. In the Database window, click Forms
  2. To create a copy of the form, right-click the Persons form and click Save As (if using MS Access 97, it is Save As/Export)
  3. (If using MS Access 97, click the Within The Current Database As radio button)
    Replace the name of the form with NewPerson and click OK  
  4. In the Database window, right-click the NewPerson form and click Design View
  5. Double-click the button at the intersection of both rulers Form Selector to display the Properties window.
    In the Properties window, click the All tab and change the following properties
    Caption: New Person
    Data Entry: Yes
    Record Selectors: No
    Navigation Buttons: No
  6. Close the Properties window
  7. Right-click anywhere in the form and click Form Header/Footer
  8. Now we will allow the user to be able to undo a record
    On the Toolbox, make sure the Control button is down Command Wizard and click the Command Button Command Button
  9. On the form click in the Form Footer section
  10. When the Command Button Wizard starts, in the first page, in the Categories list, click Record Operations
  11. In the Actions list, click Undo Record
     
    Command Button Wizard
  12. Click Next
  13. Change the Undo Record text with Reset and click Next
  14. Change the name of the button to cmdReset and click Finish
     
    New Person
  15. Test and close the form

Home Copyright © 2004-2019, FunctionX