Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to access & Need help with simple relationship

Status
Not open for further replies.

kylen1010

Technical User
Jul 14, 2005
3
US
Hi

I do not have much experience in access. I have a db with two tables. The first table, "info" stores username, password, name, email and phone. The second table, "login" stores only username and password. I would like to have a relationship setup so that when a new record is added to either of the columns, the username and password is copied to the other table. For example if I enter "bob389" as a username and "secret" as the password in the info table, I want bob389 and secret to be added to the login table. And vise-versa.

What settings do I need to have in the tables and the relationship so that this can work? I do not have a primary key in either of the tables. Do I need to have one for this to work? Thanks!
 
Why not simply a query named "login" with following SQL code ?
SELECT username, password FROM info;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Sorry I should have explained more. I need to have the two seperate tables. I cannot have one table. The login table has more users than the info table has and they need to stay seperate. I know that is confusing, but can someone please explain how to create a relationship for my situation. Thanks.
 
I think you should first read The Fundamentals of Relational Database Design to understand why this is not an "easy" thing for the database to do. A relational database should be structured so that information appears in ONE place, by trying to store the password in two places you are trying to accomplish something that a relational database is specifically trying to prevent.

If you cannot have one table, then you need to review the table structure and decide which ONE table should hold the appropriate information and leave the other information in the other table.

HTH

leslie
 
The Fundamentals of Relational Database Design really helped me in aswering a lot of basic questions I have about access. thanks. Anyway, I think I have figured out a way to only use 1 database. So thanks to everyone for their help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top