Wednesday 4 March 2009

Adding stuff to a database field

So, you have a database table.

There's a field that you want to add something like Amps to. So it's going to be, like 13 Amps or 5 Amps or whathaveyou. Always Amps.

Easy to do.

The field type'll need to be text for this.

Then you simply set up the Input Mask in this sort of way:

This should work for text fields as well - you simply need to make sure the input mask characters work properly the way you want them to.

The section in the textbook on Input Masks is p.28-29 - assuming you haven't spilt orange juice over your textbook so you can still read the pages.

You can do the same thing for an Autonumber field as well - say that you need to add a standard set of text before a stock code for example. In this case the Input Mask simply needs to be something like "STA"000 and the field type Autonumber.

All of this adds usability to your database. It makes it easier for the user to use it. This is a Good Thing.

No comments: