relationships

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sajitk
    New Member
    • Feb 2008
    • 77

    relationships

    Hi friends,

    I have 2 tables namely beneficiary and payments

    Beneficiary table
    Solar Latern No - primary key
    Beneficiary Name


    Payment table

    Solar Latern No
    Amt due

    the user enters the beneficiary details in the beneficiary table. When the payments form is opened, there is label / text box which displays the name of the beneficiary for a particular solar lantern no. the user chooses the Solar Latern No from the combo box and the name of the beneficiary should be fetched from the beneficiary table and should be displayed in the form.

    Thanking you in advance.

    Sajit
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Join the two tables and use that query as the recordsource of the form. Of course if it's a one-to-many relationship, as I suspect it is, then you should just use a subform.

    Comment

    • sajitk
      New Member
      • Feb 2008
      • 77

      #3
      Originally posted by Rabbit
      Join the two tables and use that query as the recordsource of the form. Of course if it's a one-to-many relationship, as I suspect it is, then you should just use a subform.
      Hi Rabbit,

      Thanks for the response.

      Anyways, how do i do it. can you please help me out.

      it wont be one-to-many relationship..b ecause one solar lantern no would be unique to one beneficiary. so its one-to-one relationship.


      thanks in advance
      Sajit

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        Originally posted by sajitk
        Hi Rabbit,

        Thanks for the response.

        Anyways, how do i do it. can you please help me out.

        it wont be one-to-many relationship..b ecause one solar lantern no would be unique to one beneficiary. so its one-to-one relationship.


        thanks in advance
        Sajit
        You misunderstand what I meant by one-to-many. It will be a one-to-many relationship because there will be many payments. The relationships are between tables, not within tables.

        If you don't know how to join a table then it sounds like you need to learn some SQL basics. Take a look at http://www.w3schools.com/sql/default.asp. They have an excellent SQL tutorial.

        However, since it's a one-to-many relationship. You'll want to use a subform instead. In which case you just create a form for the table on the many side and include it as a subform on the form for the one side.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32661

          #5
          Originally posted by sajitk
          ...
          it wont be one-to-many relationship..b ecause one solar lantern no would be unique to one beneficiary. so its one-to-one relationship.
          ...
          Is it true to say that each beneficiary can only ever have one single payment then?
          Otherwise, as Rabbit says, it's a one-to-many relationship.

          Comment

          Working...