How To Set Up Relational Database

I had a suggestion from a reader named “Dennis” after trying
to gather information for a new database book.

He responded:

Erik,
My suggestion is this:
Make an easy tutorial to set up a database with tools on how to setup
tables, link tables, how to set up keys on tables.
Most tutorials tell users how to set up a database for one type of database
(food).
Looking forward to the class
Regards,
Dennis Follis

I felt that this particular concept will vary based on
everyone’s different needs. So the principle probably is more helpful:

1. Always store 1 type of information in 1 table.

2. Make sure the table in step one has a unique index (Primary Key) field column.

-A unique index is a unique assignment to every row in that table.

-This unique value field column is different for every record in your table.
Much like, you cannot have the same social security number as someone else, or
your driver’s license number cannot be the same as someone else.

3. When you create another table, that contains only 1 type of information, but relates to the first table,
it needs only to reference the unique record id, or the other table’s primary key.

In other words, this is known as your “primary key” and “foreign key” relationship.

Examples:

tblFood- FoodID,FoodName

tblKid- KidID, KidName

tblKidAndFood – FoodID, KidID

FoodID is the unique identifier for every row in the tblFood table.
KidID is the unique identifier for every row in the tblKid table.

tblKidAndFood is called a “junction” table, and joins the 2 tables,
tblKid and tblFood together.

Now, I don’t want to overload you with information, so do this with your
own database and let me know if you have more questions.

Erik Loebl




By the way, if you got or are getting value from the VBA information, please give me a tip, thanks!


These posts may help answer your question too...

Shared Access Database Management

Here is a handy setup for those who need to manage a shared access database. Either you can create this from scratch as per the example or add the new tables to your existing database. This setup will track: 1. the users currently using the database 2. what time the user and computer name currently […]

Access Database Users And Permissions Example

This post is a compilation of two of my previous posts: https://vbahowto.com/ms-access-object-security/ https://vbahowto.com/ms-access-login-form-revised/ This elaborates on the two posts a bit: First, here are all of the database objects: There are 2 tables here: tblLogin and tblAdmin Here are the main forms: frmLogin – this is the form that opens when the database opens Here […]

MS Access Object Security

Today’s post is based on a question that I received. We are going to assume that there are multiple users who have rights to view different database objects. So in this example there are 3 user logins with different rights to access 3 forms and 3 reports. Here is an overview of the database setup: […]

How To Connect Access To SQL Server On Amazon Virtual Machine

In this post I am going to show you how you can connect your Access database to a Microsoft SQL Server 19 running on an Amazon Virtual Machine. Something great about the current technology is that you can have a version of something that would cost you BIGGGGGGGG Money in the past! In this case […]

Previous Post

Access 2010 Ignoring Open Of ADP File

Next Post

MS Access Beginner To Advance Propulsion