Linked Fields

Gismo

Registered User.
Local time
Tomorrow, 01:45
Joined
Jun 12, 2017
Messages
1,298
Hi All,

I have a dumb question. I have 2 sub form on a form, the first subform contains part number with qty, the second does the calculation for converstion and the cost. now when I link master and child with Product, only the first line in the form shows in sub form 2, If I remove the link, all 3 records displays but in the incorrect order, not relating to the first sub form. what am I doing wrong? I can not do the conversions in the first subform as that would require a linked query to the form which means I can not add products to the form.
 
You cannot link 2 subform directly.
You need an unbound textbox (hidden) as a link to 2nd form.
You set the value of the unbound tbox on the Current event of the first subform filling it with the pk number ir any field that is a link to 2nd subform.
 
I do have the unbound textbox, but only 1st record displays in second subform, not sure what I am doing wrong here
 
Show the fields for both tables.
 
Why did you link on product? Are there multiple calcu in 1 product. Should be on the pk of table1 and if you dont have it on table2 you should add it.
 
Form 1: Product, QTY, Unit
Form 2: Product, Cost, UnitConverted
 
Capture.JPG

Yes I linked txtProduct with Product
When I run the query on the second subform, all 3 records displays, the form is set to continuous
 
Last edited:
You have a correct output. Do you mean whatever products displayed on sub1 should also be in sub2 in correct order then what you need us a query and join the teo tables together. Use this query and eliminate sub2.
 
yes whatever is in 1 should be in 2 in the same order sequence, if I do eliminate 2 and use a query with all fields in 1, I can not add new records to the form. form 1 is updating a table and form 2 is only a calculation.
 
In the Current event of the primary subform, requery the secondary subform.

You can actually use the master child links though. You just have to include the subformname.

Master:sfrm1.IDfield
Chile:IdField
 

Users who are viewing this thread

Back
Top Bottom