Link to home
Start Free TrialLog in
Avatar of M A
M AFlag for United States of America

asked on

Need to link Subform to another subform access2010

I have an access file in which I have 1 main form and 2 subforms (subform1 and subform2) in that. I need to link subform1 to subform2. Is it possible?

Is there any other way that data on the last subform should be related to the first subform
Check the attachment for screenshot.


Your help is apprecaited
screenshot2.docx
Avatar of IrogSinta
IrogSinta
Flag of United States of America image

How is your subform1 related to the main form?  In the screenshot, it doesn't look like they're related?  Where you trying to make it so that clicking on a record in subform1, updates your main form to that particular Sno?
And is subform2 supposed to show the corresponding Bill of Lading (BOL) for your selection in subform1?
Avatar of M A

ASKER

1 PI/SC NO will have mutiple BoL No(Subform1) and 1 BoL No will have multiple container Nos(Subform2).

Main form is related to PI/Sc no in the subform1. subform2 is showing all the records as of now. I want to show only container numbers which related to that BoL No.

i.e. when we click on the second BoL No data in the subform2 should change and list the corresponding container Nos
ASKER CERTIFIED SOLUTION
Avatar of IrogSinta
IrogSinta
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of M A

ASKER

I could not find oncurrent event on both the subform's property

I managed to list the BoLs in the 1st subform by a query

Now I need to list the container nos (in subform2) based on the BoL number in subform1

Attached screenshot
Screenshot3.docx
Screenshot4.docx
Can you upload a stripped down copy of your database?  Just remove any private info first.
Avatar of M A

ASKER

Attached another db with the same data and function
Change the extension from docx to rar


When I click on BL in the first subform the second subform  data should change and list the container nos of that particular BL.
PTC.docx
can you explain how to get to that particular screen with the subforms?
Avatar of M A

ASKER

open the file--> select user 'Muhammed Asif' -->password 'nsc'
click button 'Payment/Shipment'  

It will open a form named 'DataEntry'

Awaiting your reply.
Avatar of M A

ASKER

Did you understand my explanation?
If not please let me know I will explain again
Sorry but I'm at work now and won't be able to look at i till later.
Avatar of M A

ASKER

no issues take your time n check
Here you go.  I used the first method I mentioned.  Also, since you had navigation buttons on your main form, I set the NavigationButtons and RecordSelectors properties to No.
PTC.zip
By the way, the first time you click on a subform, the property sheet shows the properties for the subform control, you need to click on the square in the upper left hand corner of the subform to see the properties of the subform itself.  That's probably why you couldn't find the OnCurrent event.
Avatar of M A

ASKER

many thanks. it is done.
how to calculate the sum  of QTYs listed in the subform
Add a textbox to your main form with this:
=Sum([Shipped_QTYs subform].[Form].[Shipment_QTY])
Avatar of M A

ASKER

Still not showing the result. It is showing error.
Your help is appreciated.
What name did you give the text box?
Avatar of M A

ASKER

TXTSUM
Avatar of M A

ASKER

I Opened another question
Avatar of M A

ASKER

Many thanks and please attend that question as you are aware of my issue
Avatar of M A

ASKER

Please help to fix this as well. A blank/extra record is showing in the second subform with the linked field no. See the attachment for example. In your file which you sent me doesn't have this extra record with only linked BoL_no.It is showing blank if there is no records(in your file sent me). Please guide me how to fix
Screenshot1.docx
Sorry but I don't quite understand what you're say the problem is.  Can you explain it a bit more?
Avatar of M A

ASKER

You can see a blank record with only BoL no.
Please find the attachment for more details with arrow
Screenshot1.docx
Did you add this line to the OnCurrent event of your Shipment_Status subform?
Parent.txtBOL = Me.BOL_No
Avatar of M A

ASKER

yes. It is added
It is not crucial. But it is little bit confusing when we see a blank BoL no
Can you export those three forms to another database and upload it so I could take as look?
Are you referring to where the field Sno in the 2nd subform shows the word (New)?
If so, then you just need to set the AllowAdditions property for that subform to No.
Avatar of M A

ASKER

Many thanks to your support
 I compared with yours and fixed
In yours there were square brackets in linking master and child mine was with out square brackets.
Anyway Many thanks and really appreciate your help