Form/ subform link problems

Z

Zedbiker

My parent form holds information about a part and my subform holds ordering
information for that part.
Up to now I have linked the child to the parent via PartID : RecordID and
Component Name : Component name. This is great as it shows the component name
on the subform after it has been found on the parent form.
The only problem with this is if the user changes the component name it does
not keep the order information for the same item with the old name.
I want to link purely on the partID : RecordID so that whatever else is
changed the order information history still shows.
When I do this the component name remains blank. What is the best way of
showing the component name on the subform. If I can sort this I also want to
be able to add a part number on the order details as well.
Should I use dlookup? If so where do I put the dlookup function and how do I
use it.

Many thanks in advance for any help.
 
M

mscertified

You need the 2 tables to be related many (subform) to one (main form). You
need this relationship defined in relationship window. Then you need the
linking field in the master and child tables specified in the subform control
on your main form.
Once this is done, your subform can show any of the columns from your child
table.

-Dorian
 
Z

Zedbiker

Many thanks for your reply.
That makes a lot of sense. I went into relationships and true enough there
was no link at all between the two tables. So I created the link many to one
as you suggested. I saved the relationship and exited. No difference. So I
went back into the relationships and the link had been removed.

I am linking RecordID(Primary Autonumber) to PartID(number). The number type
is the same (Long Integer).

Where am I going wrong?

Thanks again.
 
Z

Zedbiker

OK after reading some other threads I see that there could have been a
problem with my database relationships.
So I have created a new database and copied everything apart from the
relationships into it. I have created the relationship as you suggested.
My subform is a datasheet. It now shows all component names of the parts I
have ordered previously which is what I wanted, but when I create a new
record (new order) the component name field remains blank.

Thank you in advance for further suggestions.
 

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