Relationship

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wislace
    New Member
    • Feb 2007
    • 6

    Relationship

    Please i have two tables tblregister and tbluser.tblregi ster and tbluser have something in common.Username and password.I have created a relationship for the two tables.I want the situation whereby when i enter data in tblregister,the fields namely username and password will automatically be entered at the tbluser.Please help me out
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Your structure is wrong. These two fields shouldn't be duplicated. Have a look at this tutorial.

    Normalisation and Table structures

    I would suggest a structure something like the following:

    tblRegister
    RegisterID (Primary Key)
    UserID (Foreign Key referencing tblUser - Indexed (No Duplicates))

    tblUser
    UserID
    username
    password

    Now use the following query as the source of the Data Entry Form ...

    Code:
    SELECT tblRegister.*, tblUser.username, tblUser.Password
    FROM tblRegister INNER JOIN tblUser
    ON tblRegister.UserID=tblUser.UserID;
    Mary

    Comment

    Working...