Datasheet view provides a visual way to create a table.
You start by creating a new, blank database or by adding a new table to an existing database. Either method opens a new table in Datasheet view.
Notice that the new table contains a field called ID. That's your primary key, so you don't need to create one.
To add your fields, click the first blank field header – the words Click to Add
. That starts a menu of data types, and you select a data type for the field. After that, the field header then becomes available for writing, so...
You just type the field name and press ENTER. Doing that shifts the focus to the next field, where you repeat the process. As you work, remember that if your field names contain more than one word, don't use spaces between the words. Spaces make it harder to write Visual Basic® for Applications code and a type of formula called an expression
. It's a common practice to remove spaces entirely, or separate each word with an underscore. Also, at this stage, don’t add any foreign key fields or lookup fields. You’ll add one type of lookup field later in this course, and you’ll add foreign keys when you create your table relationships, and that’s the next course in this series.
When you've finished, press CTRL+S, or go to the Quick Access Toolbar and click Save
. That starts a Save As
dialog box, where you enter a name for the table and then save it.