Revising Data In Link child & Link Master Field (1 Viewer)

duffy

New member
Local time
Today, 15:30
Joined
Apr 19, 2009
Messages
5
I have a form for entering Purchase Orders that is comprised of a main form with PO Header info and a subform where the line item detail of the PO is entered.

The main form and subform are linked by the PO# field being the Link Master & the Link Child. The data from the main form goes to one table and the subform data goes to another table.

My problem is when you call up a PO# already saved and want to change the PO# the link is broken and only the revised PO# is saved in the main form table. Teh original data showing in the subform disappears.

When you look in the underlying tables you find the original PO# record in the subform data table but the main form data table contains both the old PO# record and the new PO# record file.

How can I maintain the link during the revision of the PO#?

Thanks for any help.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 21:30
Joined
Jul 9, 2003
Messages
11,084
It sounds like your PO# (Purchase Order Number?) Is being used to link the two tables together. This is an absolute no no for the reason you have just discovered. (Well it's one of them!)

I can't see as there's any reason to store the purchase order number in the line item table anyway as it will always be present in the PO Header table?

What I suggest you do is make backup copies first!

Then in your table, the PO Header table, add a new column, an auto number column. Now you should have your original PO# next to a new ID column.

Now you need to create a query that will replace the appearances of the he PO# In your line item table with the new ID you have created in your head or table.

Finally you need to link the subform and mainform with this new number.
 
Last edited:

duffy

New member
Local time
Today, 15:30
Joined
Apr 19, 2009
Messages
5
It worked like a charm! Thank you.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom