473,946 Members | 2,644 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Synchronizing Two Subforms

Tom
The purpose of my form is to record multiple owners of businesses. The main form
displays the business records. Subform1 is a continuous form consisting of only
a combobox to select owners from a table of owners. Subform1 contains record
selectors so after owners are entered, a specific owner can be selected. PK is
OwnerID. Subform2 is a single form based on the same owner table and its purpose
is to display details about the selected owner in Subform1. Foreign key is
OwnerID.

Since Subform1 is a continuous form, I have Subform2 external to Subform1. What
needs to be done so that as specific owners are selected in Subform1, Subform2
displays the related details about the owner selected inSubform1?

Thanks,

Tom
Nov 12 '05 #1
2 5553
Why don't you make subform 1 the main from and link subform2 (Detail
records) to the main form on OwnerID?

"Tom" <th*******@bell south.net> wrote in message
news:U_******** *********@newsr ead1.news.atl.e arthlink.net...
The purpose of my form is to record multiple owners of businesses. The main form displays the business records. Subform1 is a continuous form consisting of only a combobox to select owners from a table of owners. Subform1 contains record selectors so after owners are entered, a specific owner can be selected. PK is OwnerID. Subform2 is a single form based on the same owner table and its purpose is to display details about the selected owner in Subform1. Foreign key is
OwnerID.

Since Subform1 is a continuous form, I have Subform2 external to Subform1. What needs to be done so that as specific owners are selected in Subform1, Subform2 displays the related details about the owner selected inSubform1?

Thanks,

Tom

Nov 12 '05 #2

The general idea is to set the RecordSource property of Subform2 to
select the one record that matches the record in Subform1. When a record
is selected in the control on Subform1, attach a procedure to its
"AfterUpdat e" event to select the record in Subform2. It would look
something like:

Sub Subform1Control Name_AfterUpdat e()

Forms!NameOfMai nForm!NameOfSub form2.Form.Reco rdSource = _

"SELECT * FROM NameOfTableOrQu ery WHERE OwnerID = " _

& Forms!NameOfMai nForm!NameOfSub form1.Form! ControlNameInSu bform1

End Sub

This selects the one record in Subform2 that matches the OwnerID
selected in Subform1. Don´t forget that if the OwnerID is text then you
need to modify the SQL slightly to read :

Forms!NameOfMai nForm!NameOfSub form2.Form.Reco rdSource = _

"SELECT * FROM NameOfTableOrQu ery WHERE OwnerID = ´" _

&Forms!NameOfMa inForm!NameOfSu bform1.Form! ControlNameInSu bform1 &"´"

I hope this helps.
--
Andy Briggs
Elmhurst Solutions Limited
http://www.elmhurstsolutions.com
Posted via http://dbforums.com
Nov 12 '05 #3

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

Similar topics

3
2543
by: Keith Veleba | last post by:
Hello to all fellow c.l.p'ers! Long-time listener, first-time caller. Background: I'm working on a project where I have to do some serious multithreading. I've worked up a decorator in Python 2.3.4 to implement the lock semantics required for specific functions I want to synchronize:
1
7485
by: JJMM | last post by:
Hi, I have a form (form1) with a large number of subforms inside it (around 20 subforms), There is the possibility of filtering the data using a pop-up form that create/change a query (all the subforms are linked to that query), Once that I create/change the query (using the pop-up form), Is there any easy way to update all the 20 subforms inside form1?. Normally I use to change the recordsource in each subform to show the
3
4013
by: Evil | last post by:
Hi, i have a problem with a treeview and some subforms in MS Access97. I have a form with a treeview on the left side which lets me navigate thru some projects. Then on the right side, i have several Tabs, each with a subform. Now, my tree view nodclick code goes like: sProjNum = me.tvwX.SelectedItem.Key
1
3004
by: M Wells | last post by:
Hi All, I am developing an Access 2003 project application with the back end in SQL Server 2003. I have a master form that tracks projects, and several subforms on it that track various aspects of the project. On the masterform I have two unbound listboxes that I populate with information regarding the current record in one of the subforms.
2
3018
by: Jack | last post by:
Hi all, I searched the archives and found everyone happy with Stephen's MouseWheel On/Off code except for those with subforms. Stephen's page indicates that he has added code to handle subforms ("Bug Fix for SubForms with ScrollBars. Bug fix for SubForms without visible ScrollBars.") - BUT I still can't get it to work on my app with my subforms. I'm using Access 2000, It works fine on the main forms but not on the
0
2251
by: Jack | last post by:
Gday everyone, I'm dearly hoping Stephen Lebans is going to update his masterpeice to stop the mouse wheel scrolling to work on subforms *he has indicated this to me but of course beggers can't be choosers here so I have no idea when this would be done*. I'm just wondering if anyone has gotten around the problem some other way? --Original Thread---
5
2647
by: Richard Stanton | last post by:
Hello all My database has a main form linked to table1. It has several subforms on the main form, all linked to table2. Table1 and Table2 are linked by primary/foreign key, no duplicates allowed, one-to-one. If I update field(s) on a single subform it works fine but when I update fields on multiple subforms ie without closing the form between updates, I get the following error:
2
3726
by: Christopher D. Wiederspan | last post by:
We are getting ready to move an ASP.NET application off of a single development machine and onto a "webfarm". Basically our webfarm is a bunch of identical servers with the load-balancing provided by a network appliance. What I'm wondering is what is the best way to keep the ASP.NET (.aspx and .dll) files synchronized across all of the servers in the farm. Our ASP.NET application is very simple - we could just copy the content to all of...
1
3053
by: planetthoughtful | last post by:
Hi All, I have a form that tracks problem issues. On that form I would like to have 2 subforms with 1-to-many notes associated with each problem. On the first subform I'd like to show a datasheet view of the associated notes, with datecreated and notesubject. On the 2nd subform I'd like to show a single form view of the actual note memo field. I've placed an invisible sychronization field on the main form, which I update from the On...
4
6087
by: Harlequin | last post by:
I have a question concerning the need to trigger events within a "child" subform which is itself enbedded within a master "parent" form and which is accessible via a tab in the parent form. Becuase this is all very difficult to explain in words, please bear with me as I endevour to explain what it is I am trying to do. It would be helpful if I could attach a graphics file to this posting that would help explain what it is I'm trying to achieve...
0
9976
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11554
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10680
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9875
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8241
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7406
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6320
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4930
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3528
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.