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.
In this video I want to talk to you about Field Size Settings because they confuse a lot of people, especially the ones that are new to Access. And this is also something that can kind of trip you up, kind of as an error of omission, if you will. Now, when we choose the Number Data Type in Access we've actually completed step 1 of two important steps. We now need to make sure that we make a choice in the Field Size Settings. Now, what this is going to do is give us kind of another little knob to turn and we can control exactly the amount of memory that's used for this particular column or field. Now, what I want to do is jump out here to Access and show you exactly what I'm talking about. Now, when we're creating a field in Access, and you're going to see this a lot more later on in the course, but for now I just want you to remember that you saw this. Let's say we're putting in a new column called Part Number in our table. Now we're in the Design View on a new table. And I choose the Data Type Number out of my list and notice what's happened down here at the bottom. Under Field Size it has defaulted to Long Integer for me. But if I click this little drop-down box you can see that I have a number of choices that I can make, and these, as it turns out, are very important. Now, let's go back and talk about why because those Field Size Settings limit the size of the number that can be stored in that particular column. This lets me optimize the table's memory utilization. Now, there's a warning you need to be aware of here. If I don't give it enough space it will create overflow errors and it's going to cause some problems for me down the road. Here's an example. If we use the Byte Data Type on a column, and let's say in this column we're keeping up with the number of items that we keep on stock in inventory, we're going to do good the first couple of years because we only have 50 or 60 in stock. But when things really start cooking and the first day that we stock 256 items and we put that in the database we're going to get an error. And, basically it's going to be saying, hey, wait a minute. My box is not big enough to store what you're trying to put in it. I can only hold 255 and now you're trying to give me 256. Well, let's go through these and talk about your choices. The Byte Data Type down there in Field Size Settings, allows you to store integers from zero to 255, no decimal places, and it's going to use 1 byte of memory. Let me point out something here. If I use a larger field size, say that it's 3 bytes or 4 bytes, let's do 4, and then I only use 1 byte of actual memory, I'm only storing from zero to 255. I'm wasting 3 bytes of memory. Now, what's happening to my database, if I have a million rows in my table, to make it easy, I've got 3 bytes of memory on each one of those rows that's not being used. That comes out to 3 million bytes of unused space in my database. It's never a good idea to store nothing, alright? It's a good idea to store nothing out there in the air or the ether or the universe, whatever you want to call it, but don't put it into your databases, OK? Now, let's go through the rest of these and take a look. The Integer Field Size Setting will store integers from negative 32,768 to positive 32,767. No decimal places here. You're using 2 bytes of memory. The Long Integer, which is what it defaulted to, goes from negative 2 billion and some change - I won't give you that; that's government change there - to a positive 2 billion and some government change, OK? No decimal places here, but it's taking 4 bytes of memory for every number that you store in there, OK? The Double will go from negative 1.797 times 10,308, and I won't read every number on the screen for you, you can probably take care of that. But notice, this will give you up to 15 decimal places if you need them, and it's also going to consume 8 bytes of memory. The Single Field Size Setting, notice, goes from negative 3.4 times 1,038 and it takes 7 decimal places; utilizes 4 bytes of memory. So you can see here how you can adjust totally. If I'm trying to do a decimal number then I want to use, you know, double or single, and I can turn that knob and choose which one of those and control how much memory I'm using. And I can base that on how many places do I need in my number. And then the Decimal Type gets me up to 15 decimal places, uses 8 bytes of memory. And then the last one, it's not really a Data Type but everybody calls it one and so we'll go along with that, the Replication ID, and if you ever get into replicating your Access databases you will use this and just know this is a 16-byte memory space and it's storing a, what's called a GUID, or Gwid you'll hear them called, a Global Unique Identifier. Don't worry about what it is right now, but you just need to be aware of these Field Size Settings. And don't just choose Number and take the default. If you do you're really wasting a lot of memory space out there.
| 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 |