Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com�s entire library of video tutorials.
The Field Size is another Property on our columns that we can use to help us control the data that goes into our tables and in this video I want to show you a real quick example of setting the Field Size to help us in that regard. Now, on the State field, something's always going to happen with this field. I've seen it time and time again in database projects. Now, it probably doesn't happen where you work, but everywhere I've ever worked there's this dangerous type person who just bangs data into the table and it doesn't really occur to them that the data should be in a certain format. That is my job as the database designer to take care of that. So, you know the routine. Someone's on the phone, a new student calls to enroll in a music lesson and they get to the State field and they mean to type TN, but guess what, they type TNU. Now I don't know what state that is, and when we try to pull reports it's not going to equal TN or it's going to show up as TNU, and it's just going to look bad and everybody's going to be upset. So, here's what we're going to do. We are going to switch out to the Design View and click on the State and notice that it has a Field Size in here of 255. I'm going to delete that out and I'm going to put a Field Size of 2. Now keep in mind, this is not going to limit what's being put in, but it is going to at least limit it to two characters, and so I will click on Save to prevent being screamed at, and guess what? It happens anyway. Now what's the problem? Well, notice, it is warning me that some data could be lost, because anytime I set my Field Size property to shorter than what it was then Access is going to warn me, hey, wait a minute, now. If I've got something out there with five characters and you're now cutting it down to two, I'm going to drop three of those. So, if you're cool with that, OK, if not then say No and think about it some more. Well, I am cool with that and we will accept that and now we can go to Datasheet View. And when we get to the State and our person is on the phone, they're doing six things at once, and there's two mad customers in the store, and they try to put in TNU. Notice TN goes in but the U - can you hear that? Every time I hit the key I'm getting screamed at. So, I've at least limited the State field to two characters. Now this can help a lot of times to prevent people from putting the wrong stuff in and it's a first-level. It's not the answer, we'll get to some more later on in the course, but let's talk about this Zip Code field. It is set, if I go to Zip, to accept 255 characters. Well, what if I drop that to 5? And when somebody tries to input a Social Security number, phone number, their life story, anything like that, it's going to cut them off at 5 and hopefully that will help them to see that something's wrong. Now again, this will help you in some instances to keep some data out. It's not the end-all, but it's a good place to start and I just wanted you to see that you can manipulate this Field Size to limit how much data can be put in a particular field.
| Course: | Microsoft Access 2010 |
| Author: | Mark Long |
| SKU: | 34224 |
| ISBN: | 1-936334-91-7 |
| Release Date: | 2011-05-12 |
| Duration: | 9 hrs / 121 lessons |
| Work Files: |
Yes |
| Captions: | No |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |