Open a form and copy new form data to open form - how?

Open a form and copy new form data to open form - how?

Post by jhutching » Wed, 13 Dec 2006 06:02:01


Hello all,

I'm trying to create a form where when a user enters a value in a
certain field, it opens a new form and copies the "ID" from the new
form, to a field on the other open field.

For example, I have a form to create a new "Nonconformance".
A"Nonconformance" can be tied to a "Corrective Action" but not always.
On the "Nonconformance" form I have a field asking "Corrective Action
Required?" If the users enter "Y" into that field, I would like the new
"Corrective Action" form to appear. When they enter and save the new
"Corrective Action" I would like the ID# from the "Corrective Action"
to copy over to the open "Nonconformance" form in a field titled
"Corrective Action ID".



How would I go about doing this?

Thanks!
 
 
 

Open a form and copy new form data to open form - how?

Post by ruralguy v » Wed, 13 Dec 2006 09:22:01

If the "Nonconformance" form is still open then you can get to any control on
the form through the Forms collection.

Forms!Nonconformance!TheControlName



--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.yqcomputer.com/

 
 
 

Open a form and copy new form data to open form - how?

Post by jhutching » Wed, 13 Dec 2006 22:01:20

Hello Ruralguy -

Yes, the form will still be open. However, the field I'm trying to pass
the data to is a subform of the "Nonconformance" form.

What would be the syntax for this and how would I send the new
"Corrective Action Id" that is created from the popup form?

Thanks!
 
 
 

Open a form and copy new form data to open form - how?

Post by ruralguy v » Thu, 14 Dec 2006 01:02:55

Here's a link to put in your favorites.
http://www.yqcomputer.com/

Your syntax will look something like:
Forms!Nonconformance!SubFormControlName.FORM!TheControlName = Me.[Corrective
Action Id]

..using your control names of course!

Remember that forms are displayed on other forms by means of a SubFormControl.
This control defalts to the same name as the form it is displaying but it is
not manditory. The SubFormControl can easily have a name different than the
for it is displaying and in fact I recommend it for clarity in the code.



--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via http://www.yqcomputer.com/