A realtion from one form to the same form?

J

Jo Gjessing

Hi all,

In a database of mine I've made a form where my users are going to register
persons. There are many fields in the form, among them autonumber, name,
address, phone numbers and so on. There is also a field into which they shall
put the autonumber given to the person's wife or husband who have allready
been registered in the form. I want the form to show name the wife or husband
when her or his autonumber is put into the right field. But I wonder how do I
do this?

As I see it I need a one-to-many relation from the autonumber field in the
table to the wife-or-husband field of same table. Am I right? Or is there
another way to do it? The reason behind these words is that I've not been
able to make such a realation.

So, if you have any good ideas please give me some words. Thank you very
much in advance.

Jo
 
J

JEA

Don't really understand your table structure. Can you post a screen shot of
your relationships?

I'm also presuming you ment 'text box' when you said "There is also a field
into which they shall
put the autonumber given to the person's wife or husband". You need to be
clear what you mean as 'Field' means something specific. (If you did mean
Field, I'm sorry and I've missunderstood what you want so ignore the
following)

Create an unbound text box and enter the following:

=DLookup("[FieldName]", "tableName", "[TextBox] = [AutoNumber1]")

Where:

FieldName is the name of the field that holds the husband's/wife's name.
tablename is the name of the table that stores the husband's/wife's name.
TextBox is the name of the textbox the user enters the number in.
AutoNumber1 is the name of the field that holds the auto number associated
with the husband/wife.

This is assuming the husband/wife's details are already stored in the
database.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top