UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Linking Multiple Subforms    
 
   
idossa85
post Mar 26 2008, 09:08 AM
Post #1

New Member
Posts: 7



Hello again.

I am trying to link multiple subforms within a main form together to make a structured step-by-step data entry system.

The main form is unbound. The first subform allows the user to enter company information. The second subform (contains product info) is linked to the first by CompanyID. There is a third subform that is linked to the second by ProductID.

All together there are 4 subforms that link to each other. I was wondering if they could be all placed on a single main form and linked together.

One way I thought of was to simply pass the CompanyID or ProductID to the following subform using the On Active or On Got Focus Event.

I didn't want to have subforms within subforms, not to sure if thats the only way to do it though.

Thanks.
Go to the top of the page
 
+
rsindle
post Mar 26 2008, 09:24 AM
Post #2

UtterAccess VIP
Posts: 1,402
From: Northern Virginia



It is certainly possible to do what you are trying to do. That being said, it might be a bit painful to implement and you might want to consider a different design. (Also, are your subforms running in continuous mode or single (or a combination??))

However, to answer your question, 1 way to do this is have each subform coordinate thru the main form.
For example, put a field called txtCompanyID on the mainform.
In the current event of the first subform, put:

If isnull(me.CompanyID) then
me.parent.txtCompanyID = 0
else
me.parent.txtCompanyID = me.CompanyID
endif

Then subform 2 can use txtCompanyID as its LinkMaster field and CompanyID as its Link Child properties.
This will keep subforms 1 and 2 synched (based on subform 1's company).

This kind of thing can certainly work but to me, it seems that you are putting a lot of coordination pains on the user and having to do things in a certain order, in a certain way. I'd rethink the way you want to work it.
Good luck.
Rob
Go to the top of the page
 
+
Bob_L
post Mar 26 2008, 10:13 AM
Post #3

Utterly Banned
Posts: 7,038



Instead of using subforms, why not just use a tab control to have the appropriate fields from the table on each of them. That way there are no synch issues, the record you are on is the record you are on and all controls will edit that record, but only the parts that you choose to show on each tab.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 22nd May 2013 - 09:05 AM