Friday, November 10, 2006

Creating your user interface

As we've already seen with Access, sometimes the developers have tried to make tasks easier for us (e.g. Macros, where we don't need to use VBA as the details are hidden from us).

This is also the case when creating your user interface - there are two options. You can create normal forms and design them with your own buttons etc., or you can use a switchboard, which looks after some of the details for you and tries to create a consistent user interface.

Both have their pros and cons, and it's often a matter of personal preference, so we'll try both and you can choose!

Before we start, take a look at some examples of User Interfaces in Access:
Might be interesting to compare these designs with some Tips about Access User Interface design... We'll work through a quick exercise from our text to see how a more complicated switchboard works.

Once finished, we'll then spend 20mins creating a UI without using a switchboard for our Police Fines database - so we can compare the pros and cons of both.

Thursday, November 09, 2006

Access Challenge 2

A few weeks (Months?) ago now, we created a database to help our fictitious Police department record the Traffic Fines (Yes, of course all descriptions of police activity in this exercise are completely fictitious.) You sit down for an easy day at work playing solitaire, only to discover the following email in your inbox:
Hi again! The new Traffic Fines database is being utilised very well within the department, which is great as it's increased our revenue ;). A few of the officers have some suggestions though:
  • Is it possible to have a form where we can enter multiple offences against a person at once? Sometimes when we pull people over for speeding, we find that they've got a few defects with their car, or have broken some other regulation... We'd like to enter these multiple fines against the one incident.
  • Secondly, I hope we're not asking too much, but it'd be great when we do record multiple offences for an individual incident, to be able to see a total of the fines. For example, if Joe Blogs is pulled over for speeding (10 over the limit, $250), but we also find that his car is unregistered ($750) and he talks back to us a bit ($190 for abusing an officer), it'd be great to know that we've got a hat-trick worth $1190 straight away - kindof, calculated automatically on the form... is that possible?
We've got some new budget available to pay for the changes. Taa.
You'll need to get together in your team to:
  1. Analyse the requirements to make sure you understand them - drawing the form on paper might be a good way to do this...
  2. Review your Police Fines database design to see if the requirements can be satisfied with the current design - and if not, come up with a new design that can fulfil the requirements.
  3. Make a copy of your Police Fines database and implement a working prototype together.

Friday, November 03, 2006

Datavalidation with Access Macros

There's actually a number of ways we can validate the data on our Access forms. DatabaseDev lists 5 different ways in the article, Validating Data in MS Access. Of these, we've already seen and used the first 4! Don't believe me? Take a read now and verify that you understand the first 4... (we can talk together in class about these).

Now we're ready to learn the 5th - and most useful way... using the Before Update event to run a Macro!

Read carefully through Input Validation with an Access Macro before using this tutorial to add input validation to your Yahoo! Movies database. For example,
  1. Make sure that each new movie has a title and rating before it is submitted.
  2. Make sure that each new Complex has a Name and Location before it is submitted.