Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3
This is the forum to discuss the Wrox book Access 2007 VBA Programmer's Reference by Teresa Hennig, Rob Cooper, Geoffrey L. Griffith, Armen Stein; ISBN: 9780470047033
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 22nd, 2008, 11:07 AM
Registered User
 
Join Date: Apr 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Subform linking problem

I am having a problem with linking a sub form to a master form in Access 2007 as follows:
• TableA consisting of an Autonumber primary key field and a Text field.
• TableB consisting of an Autonumber primary key field, a Number field and a Text field
• A one-to-many relationship from the TableA Autonumber field (one side) to the Number field of TableB (many side)
• A MultiItems sub form with its RecordSource set to TableB and showing all the fields of TableB.
• A normal form with its RecordSource set to TableA and showing all the fields of TableA. Additionally the form also has a sub-form control with its SourceObject set to the MultiItems sub form. The LinkMasterFields is set to the TableA Autonumber field, and the LinkChildFields is set to the TableB Number field.

The normal form works correctly when run in Form View apart from one problem:
• A new TableA record is generated by clicking the main navigator appropriately.
• Text is entered in the Text field of the TableB sub form.
• The Text field of TableA is clicked. At this point the Autonumber field of TableA is still showing (New), and the text entered in the Text field of TableB remains unchanged.
• Text is entered into the Text field of TableA. Immediately, the Autonumber field of TableA shows a number, and the text entered in the Text field of TableB disappears.

This means that the user must enter text in the TableA Text field before entering text in the TableB text field. If not, the text entered in the TableB Text field must be re-entered after entering text in TableA Text field, an undesirable situation.

I have tried to force TableA to update when entering the subform control to get the TableA Autonumber field to have a valid number, but to no avail. I have tried to stop entry into the subform control with a suitable message to the user when there is no valid value in the TableA Autonumber field, again to no avail. And I have tried to manage the linking manually by providing suitable code and leaving the LinkMasterFields and the LinkChildFields blank. This also did not work.

I would be grateful for any comments and possible solutions to this problem.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking Problem glisando Dreamweaver (all versions) 1 September 15th, 2006 07:25 AM
Linking an unbound subform probitaille Access VBA 1 September 13th, 2006 12:27 PM
Problem with linking images in crystal reports gpdhillon Crystal Reports 6 September 6th, 2006 11:06 PM
Problem with foreach when using linking samergamer Pro PHP 1 June 24th, 2004 05:32 AM
Linking Subform using ADO Skharva Access 1 January 13th, 2004 12:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.