473,418 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

Linking Two Subforms

I have two subforms on my main form. I want the records on subform B
to correspond with the records on subform A which they do. However,
I want the records on subform A to let me know if there is a
corresponding record on subform B without having to go to subform B
to see for myself. Take a look at the screenshots of what I am
trying to accomplish at http://www.chemreport/test/helpme.htm

Main Form = ChemicalInventory w Primary IDPartNo
Subform A = EditSuppliers w Primary IDSupplier & Foreign IDPartNo
Subform B = MSDSDocs w Primary IDMSDS & Foreign IDPartNo & Foreign
IDSupplier

The code on sfMSDSDocs oncurrent event is:

Forms![ChemicalInventory].[EditSuppliers].Form! _
imgRedDot.Visible = IsNull(Me.LocalScanLink)

Forms![ChemicalInventory].[EditSuppliers].Form! _
imgGreenDot.Visible = Not IsNull(Me.LocalScanLink)

Can this be done? I am a novice with little syntax so I need help
with code if this can work. Thanks group.
Dec 3 '05 #1
2 4660
"Mike Boozer" <mb*****@wi.rr.com> wrote in
news:0p****************@tornado.rdc-kc.rr.com:
I have two subforms on my main form. I want the records on
subform B to correspond with the records on subform A which
they do. However, I want the records on subform A to let me
know if there is a corresponding record on subform B without
having to go to subform B to see for myself. Take a look at
the screenshots of what I am trying to accomplish at
http://www.chemreport/test/helpme.htm

Main Form = ChemicalInventory w Primary IDPartNo
Subform A = EditSuppliers w Primary IDSupplier & Foreign
IDPartNo Subform B = MSDSDocs w Primary IDMSDS & Foreign
IDPartNo & Foreign IDSupplier

The code on sfMSDSDocs oncurrent event is:

Forms![ChemicalInventory].[EditSuppliers].Form! _
imgRedDot.Visible = IsNull(Me.LocalScanLink)

Forms![ChemicalInventory].[EditSuppliers].Form! _
imgGreenDot.Visible = Not IsNull(Me.LocalScanLink)

Can this be done? I am a novice with little syntax so I need
help with code if this can work. Thanks group.

To synchronze the two forms, the easy way is to use the built-in
Access parent-child linking. This means that each subform's keys
need to appear on the parent form so that the other subform can
see them. They can be visible=no, it still works.

The trick is to set the values of each textbox in the Current
event of the corresponding subform.

In your case, if I read you correctly, the
EditSuppliers_On_Current event would contain statements to set
parent!txtIdSupplier = me!idSupplier
The linkparentfields property of the ChemicalInventory subform
would contain Idpartno,txtIDSupplier and the child fields
IDPartNo,IDSupplier

Access sees the change in the textbox and resets the subform to
match.

--
Bob Quintal

PA is y I've altered my email address.
Dec 3 '05 #2
On Sat, 03 Dec 2005 14:47:42 GMT, Bob Quintal <rq******@sympatico.ca>
wrote:

Or you can use an expression in the parent form control's
ControlSource property:
= SomeSubformControl.Form.SomeControl

-Tom.
<clip>
In your case, if I read you correctly, the
EditSuppliers_On_Current event would contain statements to set
parent!txtIdSupplier = me!idSupplier

<clip>

Dec 3 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my...
5
by: kkrizl | last post by:
I have a form that shows burglar alarm permits. I have a subform that shows the alarms that have occurred at the location of the permit (linked by permit number). There is a different fine schedule...
4
by: Oliver Gabriel | last post by:
Hi, i have a form linked to a table. Because it is a very large form, i placed a tab control in it with sub-forms, that correspond to the same table. If i link them with the primary key...
1
by: santociabattari | last post by:
Hi Folks, I have 3 forms I want to link, so that when I advance 1 record in one form it will update the other two with the same record in the first form. I have tried using the form wizard (I...
1
by: ppwlee | last post by:
Hi, I have created a main form with 2 subforms, Both subforms are in datasheet view. I want to be able to pick a record from subform1 and the corresponding linked record (created by a...
7
by: ApexData | last post by:
I am using the following code in my TabControl to manage subform loads. The code assigns the subForms SourceObject. - Do I also need code to DeAssign the SourceObject when leaving the Tab, I'm...
3
by: Robert McEuen | last post by:
Using A2K3, Windows XP I'm handling a many-to-many relationship with a linking table structure as follows (irrelevant fields omitted): tblIssue PK_IssueID (autonumber, primary key) IssueName...
2
by: darnel | last post by:
I have 4 hierarchical tables and want to display it all together as a form and 3 subforms, when subform displays (and allow to add/edit) only relevant items from each superior subform. Tables are:...
3
by: 6afraidbecause789 | last post by:
Think school - students - discipline interventions - misbehaviors - staff for this one....On a mainform frmStudentInterventions, I have linked a subform (sfrmMisbehaviors) with another subform...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.