473,395 Members | 1,977 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,395 software developers and data experts.

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 5514
Why don't you make subform 1 the main from and link subform2 (Detail
records) to the main form on OwnerID?

"Tom" <th*******@bellsouth.net> wrote in message
news:U_*****************@newsread1.news.atl.earthl ink.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
"AfterUpdate" event to select the record in Subform2. It would look
something like:

Sub Subform1ControlName_AfterUpdate()

Forms!NameOfMainForm!NameOfSubform2.Form.RecordSou rce = _

"SELECT * FROM NameOfTableOrQuery WHERE OwnerID = " _

& Forms!NameOfMainForm!NameOfSubform1.Form! ControlNameInSubform1

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!NameOfMainForm!NameOfSubform2.Form.RecordSou rce = _

"SELECT * FROM NameOfTableOrQuery WHERE OwnerID = ´" _

&Forms!NameOfMainForm!NameOfSubform1.Form! ControlNameInSubform1 &"´"

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
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...
1
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...
3
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...
1
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...
2
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...
0
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...
5
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...
2
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...
1
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...
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.