A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Refering to subforms on tabbed controls



 
 
Thread Tools Display Modes
  #1  
Old August 2nd, 2007, 09:27 PM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 22
Default Refering to subforms on tabbed controls

Hi
I have a main from on one tabbed page and a "daughter" form on the
other. If I select a record on the main form, can I then switch to the
second tab page and add records so that they are linked to the record
on the first tab?
Thanks

  #2  
Old August 3rd, 2007, 12:22 AM posted to microsoft.public.access.forms
Graham Mandeno
external usenet poster
 
Posts: 593
Default Refering to subforms on tabbed controls

I'm not sure I understand you. You can't have a "main form on a tabbed
page". Any form embedded in another form, whether it is on a tab control
page or not, is a SUBFORM.

Do you mean that you have a tab control on your MAIN form, where one page
contains data fields from your main form's Recordset and another page
contains a linked subform?

If so, then all you need to do is set focus to the subform (either using the
mouse or with code) after adding the record to your main form, and go from
there.

If, on the other hand, you have TWO subforms, one listing the records on the
"one" side of a one-to-many relationship, and the other listing the related
"many" records, then you can add a hidden textbox named txtLink to your main
form (not the first subform) with the following ControlSource:
=[Subform1].Form![name of primary key field]

Then, for your second subform, set LinkMasterFields to txtLink, and set
LinkChildFields to the name of the foreign key field in your many-side
table.
--
Good Luck :-)

Graham Mandeno [Access MVP]
Auckland, New Zealand

wrote in message
ups.com...
Hi
I have a main from on one tabbed page and a "daughter" form on the
other. If I select a record on the main form, can I then switch to the
second tab page and add records so that they are linked to the record
on the first tab?
Thanks



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:47 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.