Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access 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
 
Old February 8th, 2006, 12:55 AM
Registered User
 
Join Date: Nov 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to linh
Default linking form

Dear friends,

I have trouble seeing the related records on two different forms. For example, I entered the info on the first form as record #2, which is related to the info on the second form (another word, second form is the continuation of the first form . However, when I click to see the second form, the second form is still on rec #1 (which is wrong record and I want it to be shown as #2). How do I fix this?

Thank you so so much. L



 
Old February 8th, 2006, 09:41 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Do you have two independent forms or do you have a main form / subform situation?

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old February 8th, 2006, 08:52 PM
Registered User
 
Join Date: Nov 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to linh
Default

Thank you SerranoG.

I created two different program in two different ways, just in case. One with independent forms and one with subforms. I m interested in the one with independent forms. However, could you please advise on both ways if possible.

Isn't that on subform, we have to create a main table for the main form, then the other tables for the subforms and link them by record source? I think that's how we do it but I'm not sure.

L. Quality Engineer (I didn't know you work for Quality also)

 
Old February 9th, 2006, 09:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

For independent forms, you open the second form based on the current record of the first form similar to this (use your REAL names for things; I'm making names up):

DoCmd.OpenForm "MyForm2", acNormal, , "[lngRecNo] = " & Me.txtRecNo

Where I'm opening the second form based on the value of the field lngRecNo. This assumes that both forms have tables that each have a field called lngRecNo. Each will also have a textbox called txtRecNo that is bound to each's lngRecNo.

For a form/subform situation, you just have to place a subform in the main form and relate the parent/child properties of the subform to lngRecNo from both forms.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division





Similar Threads
Thread Thread Starter Forum Replies Last Post
linking anukagni Access 1 March 28th, 2006 08:21 AM
Linking a query to a form hikinfool Access 3 February 24th, 2006 06:09 PM
Linking VB 6 form and Access table takawera VB Databases Basics 1 October 15th, 2004 09:12 PM
Linking form and a table that are build separately takawera Access VBA 2 October 8th, 2003 10:18 AM
RE: Linking sherr8 SQL Server 2000 2 July 30th, 2003 02:29 PM





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