By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,970 Members | 1,669 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,970 IT Pros & Developers. It's quick & easy.

Get value from a table to a form

P: n/a
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

Nov 23 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On 21 Nov 2005 16:14:17 -0800, du*****@gmail.com wrote:
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


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

P: n/a
fredg wrote:
On 21 Nov 2005 16:14:17 -0800, du*****@gmail.com wrote:
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


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


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

Peter

Nov 23 '05 #3

P: n/a
Sorry I ment based on the two tables

Nov 23 '05 #4

P: n/a
DLookUp() works very well. Thanks Fred.

Nov 23 '05 #5

P: n/a
DLookUp() function works well for what I need. Thanks Peter.

Nov 23 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.