Creating and Using Forms Another Important Access Object

Creating and Using Forms Another Important Access Object Creative Commons License – Curt Hill.

Introduction • What is a form? • It is an object that allows you to display, edit or add data to a table or query • We can do all of these through opening a table, but forms make it easier to do • Creating forms is also easy • This is a follow-up to the Data Entry presentation Creative Commons License – Curt Hill.

Creation • Pretty easy • We select a table or query – Now Access knows all the possible fields • Click Create and select Form • Save and it is ready • How easy is this? Creative Commons License – Curt Hill.

Example • I want a form that makes entering a grade easy • We will start with Form Creative Commons License – Curt Hill.

Create New Form Creative Commons License – Curt Hill.

Results: Working Form Creative Commons License – Curt Hill.

Commentary • As soon as we create the form it is now up and running • It shows the first record • Every field is editable • Notice the record indicator at the bottom • It allows moving around and the insertion of new records • This is all most people need to know – Alas, not you Creative Commons License – Curt Hill.

The Wizard • Allows different layouts • Allows choosing what fields are used – This can be some or all – Order can be rearranged as well Creative Commons License – Curt Hill.

Starting Creative Commons License – Curt Hill.

Choosing Fields Creative Commons License – Curt Hill.

Note • Use the > button to choose one – The order that they are copied from left to right determines the order they are shown • Use the >> button to move all of them • May be removed by < or << buttons • Once a field is chosen there is no reason to choose it again – A field may only be in the form once Creative Commons License – Curt Hill.

All Chosen Creative Commons License – Curt Hill.

Four Formats Columnar Tabular Data Sheet Justified Creative Commons License – Curt Hill.

Finishing Creative Commons License – Curt Hill.

Form – Ready to Work Creative Commons License – Curt Hill.

Commentary • Like before this is ready to browse, update or add new data • Updates and additions are subject to constraint checking – Referential integrity – course and student must exist – Type integrity – value must match the type of a field Creative Commons License – Curt Hill.

Attempt to Update Number Creative Commons License – Curt Hill.

Invalid number Creative Commons License – Curt Hill.

Commentary • The first error was not that the number was invalid, but that Art 112 did not exist • The second error was also not the number was not numeric, but the validation rule requires course numbers to be larger than 99 and less than 1000 – The 12 also did not correspond to a valid course, but the validation rule can be checked without looking in course table Creative Commons License – Curt Hill.

Bottom Bar • There is some navigation helps on the bottom • A box that tells the current row and the number of rows • Buttons to: – Go to top – Go up one – Go down one – Go to bottom • There is a search box Creative Commons License – Curt Hill.

Search Box • Very easy to use • Click on field to search • Type the value to look for next in the search bar and enter Creative Commons License – Curt Hill.

Other Views • Like all good Access objects, Forms have a Design View – This allows us to make other kinds of changes to the form • Unlike Tables and Queries, Forms also have a Layout View – This gives us the ability to change the look of the form easily • We will look at both of these in more depth later – Let’s just have a quick peek now Creative Commons License – Curt Hill.

Layout View Creative Commons License – Curt Hill.

Hmm? • At first glance this just looks like the normal form • However, why is the box around department value orange? • This view allows us to change the layout: – Positions and sizes of the items • The number field is way too big – let’s fix it Creative Commons License – Curt Hill.

Changing sizes • Click on the item to change • Grab an edge and resize Creative Commons License – Curt Hill.

Size Changed Creative Commons License – Curt Hill.

Moving • • Click inside the item and drag A little trickier than sizing When sizing Access shows you the size When moving Access does not show you much so it takes several attempts Creative Commons License – Curt Hill.

Moved Creative Commons License – Curt Hill.

Once More • Once the items are moved closer the form is too large • The form itself can be resized in similar way • Last change: move right margin Creative Commons License – Curt Hill.

Resizing Creative Commons License – Curt Hill.

Old and New Creative Commons License – Curt Hill.

Values • For each field two items were given boxes: – The labeling is the field name – The value can be changed • We may also change the labeling – A field name could be retyped into something more intelligible – Especially to a novice user Creative Commons License – Curt Hill.

Changed Labels Creative Commons License – Curt Hill.

Design View Creative Commons License – Curt Hill.

Design View • Gives ability to make all types of changes • For example, the grades table has foreign keys that point at: – Courses – department and number – Students – student ID • Since we cannot enter just any value, design form allows us to do a list – This extracted from the other table • This will have to wait for another presentation Creative Commons License – Curt Hill.

Finally • Like many other presentations, this is a good start, but far from the end • Forms make data entry easier • They are less intimidating for the new user – Especially when an Access database is shared by several • We should see a demonstration next Creative Commons License – Curt Hill.
- Slides: 36