Get value from a table to a form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • duy944t@gmail.com

    Get value from a table to a form

    Hi,

    I have a two tables, Breeding and Mouse. The Breeding table contains
    information of the parent mice. The Mouse table contains information of
    the pups. Each table contains a field called DateOfBirth (of the pups).
    The relationship between the two tables is a one-to-many. They are
    linked via the LitterNumber field.

    In the Mouse form, when the user selects the LitterNumber that matches
    the LitterNumber in the Breeding table, I want to be able to get the
    DateOfBirth value of the Breeding table and display it in the Mouse
    form automatically. Is there a way to do this?

    Thanks.
    Tony

  • fredg

    #2
    Re: Get value from a table to a form

    On 21 Nov 2005 16:14:17 -0800, duy944t@gmail.c om wrote:
    [color=blue]
    > Hi,
    >
    > I have a two tables, Breeding and Mouse. The Breeding table contains
    > information of the parent mice. The Mouse table contains information of
    > the pups. Each table contains a field called DateOfBirth (of the pups).
    > The relationship between the two tables is a one-to-many. They are
    > linked via the LitterNumber field.
    >
    > In the Mouse form, when the user selects the LitterNumber that matches
    > the LitterNumber in the Breeding table, I want to be able to get the
    > DateOfBirth value of the Breeding table and display it in the Mouse
    > form automatically. Is there a way to do this?
    >
    > Thanks.
    > Tony[/color]

    You can use DLookUp() in an Unbound control on the Mouse form.
    Assuming [LitterNumber] is a Number datatype:
    =DLookUp("[DateOfBirth]","BreedingTabl e","[LitterNumber] = " &
    [LitterNumber])
    --
    Fred
    Please respond only to this newsgroup.
    I do not reply to personal e-mail

    Comment

    • peter

      #3
      Re: Get value from a table to a form

      fredg wrote:[color=blue]
      > On 21 Nov 2005 16:14:17 -0800, duy944t@gmail.c om wrote:
      >[color=green]
      > > Hi,
      > >
      > > I have a two tables, Breeding and Mouse. The Breeding table contains
      > > information of the parent mice. The Mouse table contains information of
      > > the pups. Each table contains a field called DateOfBirth (of the pups).
      > > The relationship between the two tables is a one-to-many. They are
      > > linked via the LitterNumber field.
      > >
      > > In the Mouse form, when the user selects the LitterNumber that matches
      > > the LitterNumber in the Breeding table, I want to be able to get the
      > > DateOfBirth value of the Breeding table and display it in the Mouse
      > > form automatically. Is there a way to do this?
      > >
      > > Thanks.
      > > Tony[/color]
      >
      > You can use DLookUp() in an Unbound control on the Mouse form.
      > Assuming [LitterNumber] is a Number datatype:
      > =DLookUp("[DateOfBirth]","BreedingTabl e","[LitterNumber] = " &
      > [LitterNumber])
      > --
      > Fred
      > Please respond only to this newsgroup.
      > I do not reply to personal e-mail[/color]

      If you make a querie based on the two forms you can then desplay all
      the data on a form.
      Hope this helps

      Peter

      Comment

      • peter

        #4
        Re: Get value from a table to a form

        Sorry I ment based on the two tables

        Comment

        • Tony

          #5
          Re: Get value from a table to a form

          DLookUp() works very well. Thanks Fred.

          Comment

          • Tony

            #6
            Re: Get value from a table to a form

            DLookUp() function works well for what I need. Thanks Peter.

            Comment

            Working...