You are on page 1of 15

Validation, Input Masks & Look

Field: Title
Click the Title in the Field Name column then go down to the General tab at the bottom.
Because the title field will always contain a title i.e. Mr., Mrs., Miss or Ms., It would be
appropriate to set a validation rule so that whenever anything else is inputted other than
these text strings. This is basically used to remind the user what he can input into the
database accordingly. This is done by typing the following in the Validation Rule box: Mr.
Or Mrs. Or Miss Or Ms. By doing this it now means that if anything other than the
specified text is entered, then the database will reject it and will not allow the input unless it
fits accordingly with the database. In the Validation Text area it is possible to write your own
personal error message. This basically gives the user a helping hand into what he must input
in order for the database to accept.
I chose to simply write: Please enter Mr., Mrs., Miss or Ms.

To test this validation rule works, I inputted something else which didnt fit with the
database. In doing so I was greeted with this message stating what I must do to make the
database accept the information.





There is also another way to make a sort of validation rule which I consider is the easier
approach to input data into the database. This is because after the Wizard you will only be
able to choose what is on the field instead of anything else. To start this you must click on
one of your Field Name i.e. Title, then you must click on the right side of your Field
Name to go into Data Type. From there click on Lookup Wizard to take you to the
next step.

Here you will be given a choice to either make the wizard choose automatically and could be
used for the creation of a larger lookup column or you can enter in your values manually. I
chose to enter them manually as I knew what they were.









Here i will be able to input what text strings I want for the lookup column. I wrote similar
things to the validation rule and after that I finished by clicking on next.

After the Lookup Wizard was finished, the field will now have a drop-down menu containing
what I had filled in for the lookup column. This is quicker and easier than the validation rule
as you can only choose the following which have been inputted giving the user ease of use.

Field: Card Type
Seeing as there were few different card types it would seem appropriate to set a validation
rule. This is basically similar to how the Field: Title validation rule was set and should follow
the same principle.
For the Validation Rule I wrote: Armenian Express Or Francard Or Mister Card Or
Socket Or VISTA
I also wrote a Validation text in which it states what must be done to fit the criteria.
To test

To test this validation rule works, I inputted a different card which wasnt in the database. In
doing so I was greeted with this message stating what I must do to make the database
accept the information.



Seeing as there were only 5 different card types I also decided to go with the Lookup
Wizard as well.








Field: Card Number
For Card Number there could be no validation rule as the numbers do not follow a trend.
However it can be said that each Card Number always contains 12 numbers so I decided to
change the Field Size to 12. This means that only 12 characters can be inputted into the
database. Anymore characters exceeding the database will not be allowed.

Field: Postcode
After analyzing the database i can see that there is no chance of setting a validation rule as
the Post Code varies too much. However we can see that Post Codes follow a trend in which
it takes the same layout for example:
SA7 6ZY
By using L for letters and 0 for numbers the format is always:
LL0 0LL
This layout can be achieved by highlighting the Post Code Field and then by clicking on the
Input Mask Wizard. You will then need to modify the default input mask to suite the layout
recognised earlier. In order to do this I had to choose Zip Code as I didnt see Post Code and
because I know that USA use Zip Codes.


Using the L and 0 sequences from before, the input mask reads as follows:
>LL0 0LL
The wizard asks to specify a Placeholder Character which allows the user to see how much
data is left to be entered.








Here you will be given a choice into how the data should be stored for the Post Codes.
(Either with spaces or without)

This basically tells you that you have finished the Input Mask Wizard setup and will create
the input mask on your specifications.

As you can see the input mask is in use and we can see how the input mask is in place. It
shows that placing a number in a place where letters are supposed to be placed will not
work (and vice versa). THIS rule allows the user to be more accurate as it gives a definitive
specification of location.

Field: Expiry Date
I have set an Input Mask on the Expiry Date field also as the date will always take the
format:
00/00/0000
Where 0 = numbers. To do this I selected the Input Mask Short Date in the wizard

The Input Mask should be set as default to 00/00/0000

After going back to Database View I can see that the numbers are placed correctly and you
can only input a number.

(Field: Order Date has the same input mask)
For the Expiry Date on the credit card it should always be a future date. If the date for expiry
was before the present day, then the credit card would be invalid and would not work. For
this reason a validation rule was needed to be created so that the database will only accept
dates in the future.
To do this the validation rule uses this expression:

>Date()

> means more than and the Date() represents the current date. This basically means that
the expiry date must be more than the current date.
I also wrote a Validation text in which it states what must be done to fit the criteria.


To test this validation rule works, I inputted an expiry date before the current date. In doing
so I was greeted with this message stating what I must do to make the database accept the
information.


Field: Type
Seeing as there were few different types of genre it would seem appropriate to set a
validation rule. This is basically similar to how the Field: Title & Field: Card Type validation
rule was set and should follow the same principle.
For the Validation Rule I wrote: Biographical Or Children Or Education Or Fiction Or
Non-Fiction
I also wrote a Validation text in which it states what must be done to fit the criteria.














To test this validation rule works, I inputted a different genre which wasnt in the database.
In doing so I was greeted with this message stating what I must do to make the database
accept the information.

Seeing as there were only 5 different types of genre also decided to go with the Lookup
Wizard as well.

You might also like