Nov 13 2006, 08:21 AM
I have two forms. When I click a yes/no box on form 1 it will open up form 2. I would like the fields I have on form 2 to be populated with information that is on the current form 1 at the time I click the yes/no box on form 1. Then I would like the information on form 2 which came form 1 to populate a new table. How can I do this?
Nov 13 2006, 10:05 AM
The question is WHY would you do this. Duplicating data is against the very priniciples on which relational databases were founded. You can DISPLAY related data on a form. This FAQ
tells you how. But there should be no reason for you to duplicate data.
Nov 13 2006, 10:13 AM
Okay say I don't want to put the data from Form2 into a new Table. I still want certain fields on Form2 to be populated from Form1 (current form) How do I do this?
Nov 13 2006, 10:29 AM
Did you read the article I linked you to?
Nov 13 2006, 10:38 AM
Yes I did and none of the solutions offered was what I was looking for. When I open Form2 from Form1 I want certain fields from Form1 to Populate Form2. Do you know of a way to accomplish this from the way I have asked for this posting?
Nov 13 2006, 10:44 AM
Then you didn't read the the article carefully. It details several methods of populating controls from a related table. The one piece you may be missing is how to identify the record when opening Form 2. For this I would pass the PK value of the record on Form 1 using the Open Args Argument of the Open Form method. Then, using the On Open event of form 2 to run code like:
If Not IsNull(Me.openArgs) Then
Me.txtforeignkeycontrol = Me.OpenArgs
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here