Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 What to do before class starts??? Download the sample database from the k: drive to the u: drive or to your flash drive. The database is named “FormBelmont.accdb”

Similar presentations


Presentation on theme: "1 What to do before class starts??? Download the sample database from the k: drive to the u: drive or to your flash drive. The database is named “FormBelmont.accdb”"— Presentation transcript:

1 1 What to do before class starts??? Download the sample database from the k: drive to the u: drive or to your flash drive. The database is named “FormBelmont.accdb” It is located in the directory called: k:IS201\IS201-Edberg\LabClass

2  Purpose of using forms ◦ Data entry vs. data view ◦ Structure of data that underlies forms  Methods of creating forms  Structure of forms  Issues in developing forms ◦ Forms can be complex and time-consuming to create because there are many options available to the computer systems professional. 2

3  To “mask” the underlying database from casual users.  To enter data into tables.  To look at data in a more informative format than available in datasheet view. 3

4  Go to database tools and select relationships to see the structure of the database.  Not a great database design. There is significant data redundancy in the Invoice table.  This database includes some of the work that you will have completed by the end of tutorial #6.  Open and examine some tables. ◦ Open the tblCustomer. Examine the contents of the table in datasheet view. Is this easy to read for a casual user of computers? ◦ Open the tblInvoice. Add a new invoice to the table. Is it easy to add a new invoice for a casual user of computers?  Forms are created by computer system professionals for use by people who are not computer system professionals. ◦ If forms don’t make data easier to enter, then they aren’t useful. ◦ If forms don’t provide more information than can be obtained from a datasheet view, then they aren’t useful. 4

5  Close the open tables.  Open the form called “frmCustomerDataEntry” ◦ Try out the Select Customer combo box, the add customer button, the delete customer button, and the next record navigation button. ◦ The goal of these navigation methods (buttons and combo boxes) is to provide an “easy to use” method of data entry.  Let’s build the same thing. ◦ Click on tblCustomer in navigation pane – don’t double click. ◦ Select Form Wizard. ◦ Select tblcustomer. All available fields. ◦ Columnar layout. ◦ Call the form “frmCustomerStuff”. ◦ This is the form automatically generated from MS Access. ◦ Navigate for different records on the form. ◦ Add a new record. ◦ Delete a record. 5

6  Understand the form modes. ◦ Form view vs. layout view vs. design view.  Understand the property sheet. ◦ Available in layout and design views. ◦ Explains the overall properties of the form as well as detailed information about each object on a form.  Understand the structure of a form. ◦ Go to design view. ◦ All forms are composed of: Form header, detail, and form footer.  Some things are very easy to change on a form. ◦ Go to layout view to modify the labels and title. ◦ Click in the Form header and change the title of the form to say: Update Customer Data. ◦ Highlight all the labels. Make them right justified instead of left justified. Scoot them all over a little to the left. 6

7  Always save your form after doing modifications that you like.  Move between design, layout, and form view to modify and test your form.  Go to design view. ◦ Extend the form footer line down to give you more room in the detail part of the form. ◦ Highlight all boxes. ◦ Move all the existing parts of the form down. ◦ Make the form a little wider on the right side of the form. ◦ Change the color of the labels. Make it whatever color you want to use for the buttons. I used very dark blue on the sample form, but you can select whatever color you want. ◦ Make the labels bold. ◦ Add a line at the top of the data entry fields. This is a little harder because you have to go to the controls, select a line control, place it where you want to go, and drag it across the screen. If you press the key while doing this, the line will be straight. 7

8  Save your form (if you haven’t done it recently).  Go to design view.  Let’s add a combo box to navigate to a customer. ◦ Make sure that the “Use Control Wizards” option is highlighted in the controls area. Need to click on the down arrow in the controls area to see if it is highlighted. ◦ Check out all the controls you can put on a form. ◦ Click on the combo box control. ◦ Put it in the Form Header area of the form. Click on it. The Combo Box Wizard should appear. If it doesn’t, then either you clicked too much, or you don’t have the “Use Control Wizards” option highlighted. Try it again. ◦ You should see three options. I want the combo box to get the values from another table or query. I will type in the values that I want. Find a record on my form based on the value I selected in my combo box. ◦ Select the last one “find a record…” and press. ◦ This should remind you a bit of the lookup wizard. They are very similar. Go to the next slide or listen and watch in class. 8

9  Combo box wizard continued… ◦ Select the customerID, FirstName, LastName, and Company in that order. Press. ◦ Unclick the “hide key column”. Microsoft recommends that you hide it, but I don’t. ◦ Size the fields appropriately. This is what the user will see when they use the combo box. Press. ◦ Type in a label you think would help a user understand what to do. I think that “Select Customer” is helpful. Press.  Test it. Never invest time in making anything pretty until you test it! ◦ Test your combo box by going into Form view. ◦ If it works, save it.  Now make it pretty. ◦ Drag around the box to get it where you want it to be. You can move a little bit at a time with the arrow keys. ◦ Change the colors, make it bold, whatever. Make it look good. 9

10  Save. Always save before doing something new.  Go to design view.  Find the button control and click on it. ◦ Decide where you want to put the button on your form. This is going to be the button to add customer records. ◦ The Command Button Wizard should appear on the screen. ◦ Select the category “Record Operations”. Select the action “Add New Record”. Press. ◦ Select the radio button “Text”. Type in the text you want to sit on top of the button. Mine says “Add Customer”. ◦ Type in a meaningful name for your button. Don’t put spaces in the name!!! Mine says “AddCustomer”. Press.  You have a button! Probably ugly, but a button! Go to form view and test it. If it works, save the form. If it doesn’t, ask for help.  Go back to design view and do the same thing, but add a button to delete a record. Go to form view and test it. Save the form. 10

11  Go to design view.  Select both buttons. ◦ Change the background color of the buttons. ◦ Select the Format tab. Change the shape fill. Mine is dark blue. ◦ Change the shape outline. Mine is very dark blue. ◦ Change the shape effects. I like shadows and bevels for buttons, but you can do whatever you want. ◦ You might notice that you can’t read the words on the buttons any more. Time to fix that. ◦ Click on the home tab. Change the font color to white. Make the font size a little smaller, maybe 10 point. Make the font bold.  Make the buttons fit a bit better on the form. Change the box size, move them around, align them, it is up to you.  Test the buttons in the Form View.  Save your form!!! 11

12  Go to design view.  Find the button control and click on it. ◦ Decide where you want to put the button on your form. This is going to be the button to go to the next customer. ◦ The Command Button Wizard should appear on the screen. ◦ Select the category “Record Navigation”. Select the action “Go to Next Record”. Press. ◦ Select the radio button “Text”. Type in the text you want to sit on top of the button. Mine says “Next Customer”. ◦ Type in a meaningful name for your button. Don’t put spaces in the name!!! Mine says “NextRecord”. Press.  Make another button that will go to the previous record. Call it the “Previous Customer” button.  Test the buttons and save your form.  Go back into design view and make the buttons pretty.  Test and save your form! 12

13  Go to navigation pane and select the frmContractsAndInvoices. ◦ This form is created in tutorial #6.  Major concepts to note: ◦ Main form vs. subform. ◦ Main form vs. subform structure follows the database. Main form is the parent table, and subform is the child table. ◦ Calculations in the main form. Where did they come from? Why are they in the subform? ◦ Make sure to review the property sheet. The property sheet is always the key to understanding the contents of a form. ◦ Can all the data be modified on the whole form? What data can’t be modified? ◦ What is the purpose of the customerID combo box? ◦ Should a form like this be used to enter and update data?  Close the form. 13

14  Go to navigation pane and select the frmContractInvoiceClass. ◦ This is a copy of the form frmContractsAndInvoices.  Delete the customerID label and the customerID combo box.  We are going to replace the combo box with the name of the customer. ◦ Create a textbox control on the form where the customerID combo box used to be. ◦ I want this box to contain the firstname and the lastname of the customer. ◦ Type: =firstname + lastname in the combo box. ◦ Test the form. What happens? ◦ The firstname and lastname fields are not on this form, so they can’t be referenced within the form. We must first add the fields from the table before they can be used on the form. ◦ Click on the Add Existing Fields button within the design tab. ◦ Notice that the customer table is not visible. Click on Show all Tables. ◦ Expand the tblCustomer at the bottom of the screen. ◦ Double-click on firstname and lastname. 14

15  The fields are ugly. ◦ This is OK because we are going to delete them from the form after we use them.  Test the form. ◦ Yes, it is really ugly because the name fields are just there in the screen. Ignore them. Honest. ◦ Look at the textbox where it used to have an error. It now contains the name. This means that the test worked.  Now we make it pretty. ◦ Go back into design view. ◦ Delete the firstname and lastname boxes you added. Delete the labels, too. ◦ Test the form again. Notice that the customer name is still there. Save the form and go back into design view. ◦ Modify the combo box so it says: =[FirstName] + “ “ + [LastName] ◦ Modify the label so it says: Customer Name in 11 point font. Maybe make it dark blue or bold. ◦ Test and save the form. 15

16  Do you want a user to be able to change everything on this form?  Modify the editability of a form. ◦ Go back to design view. I hope you are getting comfortable with design view. ◦ Click on the ContractNum data field. Not the label, the textbox that has the ContractNum data. ◦ Click on the property sheet, if it isn’t already visible. ◦ Click on the data tab. ◦ Make the locked selection “yes” instead of no. ◦ Do the same thing for the ContractType data field. ◦ Go to form view. Try and enter data in those two fields. 16


Download ppt "1 What to do before class starts??? Download the sample database from the k: drive to the u: drive or to your flash drive. The database is named “FormBelmont.accdb”"

Similar presentations


Ads by Google