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

J

jhutchings

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!
 
R

ruralguy via AccessMonster.com

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

Forms!Nonconformance!TheControlName
 
J

jhutchings

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!
 
R

ruralguy via AccessMonster.com

Here's a link to put in your favorites.
http://www.mvps.org/access/forms/frm0031.htm

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.

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!
If the "Nonconformance" form is still open then you can get to any control on
the form through the Forms collection.
[quoted text clipped - 26 lines]
Message posted via AccessMonster.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top