Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / February 2008

Tip: Looking for answers? Try searching our database.

Select record from a subform to display on the main form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sammie - 02 Feb 2008 19:01 GMT
I have a main form bound to tblVendors with a subform bound to tblContacts.  
How can the user select one record from the subform, bring it to the main
form, and have it remain there every time the record on tblVendors is opened
until the user changes the subform record selection?

The subform has the following fields:  contactname, phone, fax, email.  I
want all four of these fields to be brought to the main form.

Signature

Thanks.
Sammie   Access 2003

boblarson - 03 Feb 2008 03:01 GMT
I think you are misunderstanding what a subform is for.  USUALLY, a subform
is used to display the many side of a one-to-many relationship.  So, in other
words, it is used to display all records on the many side that are related to
the record currently selected on the main form.

So, in your case you are saying that the subform is just holding unrelated
data to the main form but you want to use the data from that to put in the
main form.

I, personally would use a list box instead for this, but you can set a
double-click event to insert fields from the currently selected record on the
subform to the currently selected record on the main form by simply using:

With Me
  .Parent.YourTextBoxOnMainForm = .YourSubformTextBox1
  .Parent.YourTextBox2OnMainForm = .YourSubformTextBox2
  .Parent.YourTextBox3OnMainForm = .YourSubformTextBox3
End With

etc.

Signature

Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
If my post was helpful to you, please rate the post.
__________________________________

> I have a main form bound to tblVendors with a subform bound to tblContacts.  
> How can the user select one record from the subform, bring it to the main
[quoted text clipped - 3 lines]
> The subform has the following fields:  contactname, phone, fax, email.  I
> want all four of these fields to be brought to the main form.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.