Relationships

AndrewKent

Well-known Member
Joined
Jul 26, 2006
Messages
889
Hi there folks,

As I am new to building databases I'm getting a little bit confused here. I have two tables (tblStaffData and tblContractData) which have a 1 to 1 relationship. Each member of staff has a record for their contract details. I wanted to put basic staff data on one table and contract data on another as the contract data contains sensitive information that's best kept separate.

Now, both tables contain a Primary key called SalaryReferenceNumber (SRN for short) which is a Numeric field (for example 1234567). The ".mdb" file will be updated from Excel/VBA (I am currently building a program that can create/edit/delete records within the ".mdb" fil). Why Excel/VBA? Well, only I have Access and the rest of the department has Excel/VBA.

Anyway, if a new record is created in this way, would I have to enter the SRN code on BOTH tables? Or because it's a 1 to 1 relationship, would this happen automatically?

A little bit of advice would be great here (as I am still trying to wrap my head round relationships).

Andy
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Nothing will appear in any table unless you explicitly add it, the type or relationship between tables doesn't matter, unless you add something or have code to do it automatically it isn't going to be added to the table.
 
Upvote 0
Hi there folks,

As I am new to building databases I'm getting a little bit confused here. I have two tables (tblStaffData and tblContractData) which have a 1 to 1 relationship. Each member of staff has a record for their contract details. I wanted to put basic staff data on one table and contract data on another as the contract data contains sensitive information that's best kept separate.

Now, both tables contain a Primary key called SalaryReferenceNumber (SRN for short) which is a Numeric field (for example 1234567). The ".mdb" file will be updated from Excel/VBA (I am currently building a program that can create/edit/delete records within the ".mdb" fil). Why Excel/VBA? Well, only I have Access and the rest of the department has Excel/VBA.

Anyway, if a new record is created in this way, would I have to enter the SRN code on BOTH tables? Or because it's a 1 to 1 relationship, would this happen automatically?

A little bit of advice would be great here (as I am still trying to wrap my head round relationships).

Andy

You indicate a 1 to 1 relationship which to me implies that 1 staff can work on only one Contract. You may want to look at this reference: http://r937.com/relational.html

Nothing will magically appear in tables unless you or your program puts it there.
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top