Operation between Tables! (1 Viewer)

katjuba

New member
Local time
Today, 17:01
Joined
Aug 30, 2021
Messages
6
Hi Guys,
I'm a newbie of the crowd and I've a problem.
This is the situation:
I have 3 tables, and relative forms.
The first tab is a list of "product_parts" with name and specific characteristics, size, weigh, technical stuff, etc.
The second is a list of "products" with name, and product characteristics.
For each products are related different "product_parts", then
The third tab is a list of "product_parts" related to one product with relative calculations.
(I can say, it look like an invoice form with sub_form, a one to many relation)
Into the tab3, I input the "name" of the product parts choosing from a list box connected to tab1,
then I input the quantity, the cost and then I have some calculation fields based on data fields of tab1,
in the corresponding record of the specific "product_parts" selected, related to quantity and cost.
Here is where I am.
I can't access to corresponding data fields of tab1 from calculation fieds on tab3.
How can I take data related to a specific "product_parts" from tab1 fields and get them available in tab3?
I tried in a few way with query but didn't work.
I hope I was clear. Maybe it's a silly thing,
Can you suggest me something, please?
Thanks for your time.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:01
Joined
Oct 29, 2018
Messages
21,447
Hi. It might help get to a solution faster if you are able to post a sample db with test data. Is that possible?
 

katjuba

New member
Local time
Today, 17:01
Joined
Aug 30, 2021
Messages
6
How can I do it?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 09:01
Joined
Oct 29, 2018
Messages
21,447
How can I do it?
Okay, normally, I think you would need at least 10 posts to post a file, but maybe you can post images now. Give that a try first.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 17:01
Joined
Feb 19, 2013
Messages
16,601
if you post an access file, make sure you compact it then zip it, then copy/paste the zipped file to your post, or click on the 'attach files' button
 

katjuba

New member
Local time
Today, 17:01
Joined
Aug 30, 2021
Messages
6
Yes, thanks.
This the sample.
 

Attachments

  • Product_test.Zip
    26.1 KB · Views: 314

CJ_London

Super Moderator
Staff member
Local time
Today, 17:01
Joined
Feb 19, 2013
Messages
16,601
your form does not include any tabs, so not clear what you are trying to do.

You are using lookup fields which is a bad idea. Remove the lookup and you will have a much clearer idea of what you actually have as data. See these links

and a more detailed one


if you are trying to reference a control on the same form, a different form or subform, see this link for all the variations

 

mike60smart

Registered User.
Local time
Today, 17:01
Joined
Aug 6, 2017
Messages
1,913
Hi Guys,
I'm a newbie of the crowd and I've a problem.
This is the situation:
I have 3 tables, and relative forms.
The first tab is a list of "product_parts" with name and specific characteristics, size, weigh, technical stuff, etc.
The second is a list of "products" with name, and product characteristics.
For each products are related different "product_parts", then
The third tab is a list of "product_parts" related to one product with relative calculations.
(I can say, it look like an invoice form with sub_form, a one to many relation)
Into the tab3, I input the "name" of the product parts choosing from a list box connected to tab1,
then I input the quantity, the cost and then I have some calculation fields based on data fields of tab1,
in the corresponding record of the specific "product_parts" selected, related to quantity and cost.
Here is where I am.
I can't access to corresponding data fields of tab1 from calculation fieds on tab3.
How can I take data related to a specific "product_parts" from tab1 fields and get them available in tab3?
I tried in a few way with query but didn't work.
I hope I was clear. Maybe it's a silly thing,
Can you suggest me something, please?
Thanks for your time.
Hi
Your data displays as follows on your Forms.
What is the purpose of the Fields TK, PK, CK & FK ?
Why have you these fields in Both Tables ?
I removed the lookup on your field in the table.
 

Attachments

  • Form Display.JPG
    Form Display.JPG
    53 KB · Views: 309
Last edited:

katjuba

New member
Local time
Today, 17:01
Joined
Aug 30, 2021
Messages
6
your form does not include any tabs, so not clear what you are trying to do.
Sorry CJ, but I'm not understanding. Please be patient.
In the db sample there are 2 form connected to 2 tables.
(Tab as abbreviation of table) Is't right?
 

mike60smart

Registered User.
Local time
Today, 17:01
Joined
Aug 6, 2017
Messages
1,913
Have you looked at the example I uploaded?
Can you answer my questions?
 

katjuba

New member
Local time
Today, 17:01
Joined
Aug 30, 2021
Messages
6
Hi
Your data displays as follows on your Forms.
What is the purpose of the Fields TK, PK, CK & FK ?
Why have you these fields in Both Tables ?
I removed the lookup on your field in the table.
Thanks Mike very kind.
You're right. It look like that, but let me explain:
The fields Tk, Pk, Ck, Fk in the product form are the sum of Tk, Pk, Ck, Fk in product_parts sub_form.
And Tk, Pk, Ck, Fk in product parts sub_form are fields calculation base on data fields in table1, called row_parts.
I give you a new updated db file.
 

Attachments

  • ProductDB_Test.zip
    42 KB · Views: 251

mike60smart

Registered User.
Local time
Today, 17:01
Joined
Aug 6, 2017
Messages
1,913
Sorry but your answer does not make sense.

What is you calculation to get the Sum to store in the TK, PK, CK and FK on both the Main Form and Sub Form??
 

Attachments

  • Form.jpg
    Form.jpg
    149.2 KB · Views: 173

CJ_London

Super Moderator
Staff member
Local time
Today, 17:01
Joined
Feb 19, 2013
Messages
16,601
The confusion is there is a tab control for forms which is what I assumed you meant
 

Users who are viewing this thread

Top Bottom