472,353 Members | 1,192 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Creating a one to one relationship

43
Hi,
I have a 'Client table' and a 'Credit Card table' that need to be seperated for security reasons but I am not sure how you set up the one to one relationship. I currently have the two Primary Key fields ('Client ID' and 'Cardnumber') linked together and this appears as a one-to-one relationship in the relationships table. However, I am not sure if this is correct as the cardnumber field will not let me change the properties e.g. input mask and data type for a credit card number and defaults to those of the clientID.

Am I doing something wrong? More details including field names can be included in necessary.

Many thanks in advance for any help

Edd
Mar 8 '07 #1
5 15343
NeoPa
32,511 Expert Mod 16PB
You would need a ClientID field (or equivalent) in both tables.
It would be PK in the 'Client Table' and FK in the 'Credit Card Table'.
Mar 9 '07 #2
MMcCarthy
14,534 Expert Mod 8TB
Edd

As NeoPa says the tables should be as follows:

tblClients
ClientID (Primary Key)
ClientName

tblCreditCards
CardNumber (Primary Key)
ClientID (Foreign key referencing the primary key of tblClients)

The relationship between these two tables is based on the ClientID. Now you need to do two things.
  1. In the tblCreditCards table, set the indexed property of the ClientID to Yes (No Duplicates). This will enforce a one to one relationship
  2. click on the relationship in the relationship and tick the referential integrity and cascade boxes.
Mary
Mar 10 '07 #3
xian2
43
Many thank to both NeoPa and Mary for your great advice.

You have been really helpful in the creation of my database and I will undoubtedly return for some more assistance - if you can put up with me that is!

All help is very much appreciated and this is a truly wonderful service.

Best wishes and I hope to be able to help people also in the near future.

Edd
Mar 11 '07 #4
MMcCarthy
14,534 Expert Mod 8TB
You're welcome.

Mary
Mar 11 '07 #5
NeoPa
32,511 Expert Mod 16PB
Many thank to both NeoPa and Mary for your great advice.

You have been really helpful in the creation of my database and I will undoubtedly return for some more assistance - if you can put up with me that is!

All help is very much appreciated and this is a truly wonderful service.

Best wishes and I hope to be able to help people also in the near future.

Edd
That's a great attitude.
We can never have too many experts.
Mar 11 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Brian S. Smith | last post by:
Hi gang, Please help. I've been through the Access help, searched the Web, and I can't seem to get a straight answer. As the Subject line...
4
by: Ronnie | last post by:
Ok let me just say first that I am a newbie in Access and I don't know much of SQL or VB programming. But I am trying to create this contact...
5
by: Mike Turco | last post by:
What is the difference between creating relationships in the front-end vs. the back-end database? I was trying to create a relationship in a...
3
by: CAD Fiend | last post by:
Hello, I have a land development project that has a many-to-many relationship. I have ONE question regarding table structures, and ONE question...
1
by: Kosmos | last post by:
Hi...I'm new but decided to take on learning access programming for my job and I'm having trouble building relations. Any help would be very...
1
by: MRW | last post by:
Hello! I'm trying to create a dataset with a relationship inside a class, so it can be used on multiple pages. If I create the dataset in the...
3
by: solargovind | last post by:
Hi, I am New to this forum. I need steps that i do in creating subform. In main form, i have one table fields like vendor,account,due...
10
by: Richard | last post by:
Hi folks, thanks for taking the time to read this (and hopefully point our where I'm going wrong). The scenario: I have a local Access2007...
2
by: adwest | last post by:
Forgive me if this is a foolish question. I "play" in Access and have only created a few rather simple relational databases. My knowledge and...
6
by: NicoleCartrette | last post by:
Going back to school is easier said than done.. This was posted to an older thread earlier but I don't think it got any attention. Your help is...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.