Data from Form to Table

key1pop1

New member
Local time
Yesterday, 19:23
Joined
Jun 6, 2011
Messages
8
First off I apologize if this is in the wrong section and/or if this issue has been answered I tried searching for it before I posted.


I have a form (say F1_FRM) that collects information on a production from a user. On this form there is a button which opens another form (F2_FRM) to add actors to this production. Form1 and Form2 correspond to Table1 and Table2 respectively. Table 1 to record Productions, Table 2 to record Actors. Table 2 has a field which needs to correspond to the key (production ID) of the related record in Table 1 (AKA what show the actor is in).

The Issue:
I have tried several different ways but I can not get the following to work; When you press a button on F1_FRM, which opens F2_FRM, I want the value of prod ID (on F2_FRM) to be auto set to the number of the production on F1_FRM when the button was pressed. This is so the User does not have to look up the production number again once they are entering actor information.

I hope that makes sense, I appreciate any help on this matter.
Thank you!
 
A common way to handle this is to use the power of Access' sub forms. Access can then automatically handle setting the primary key in form 1 as the foreign key in form 2.


if Yuy must use a pop-up for then you have two options:

1) push the data. You could use the open args to pass the value when the pop up form is opened.

2) Pull the data. You could use the second form's on current event to get teh data from the first form using a form reference.

Note: using a sub form requires no VBA coding.
 
Thank you for your reply,
Yah, I was looking into using sub-forms but there are a couple different secondary tables that I will need to do this for so I think pop-ups will end up being the cleanest even if they are not the easiest solution.

I will look up more on both methods you mentioned.
Thanks again!
 
Thank you for your reply,
Yah, I was looking into using sub-forms but there are a couple different secondary tables

With Access this is generally handled with the Tab Control. Each page of the Tab control will have a different sub form.

Still, no VBA code required with a tab control and sub forms.

For what it's worth, I find most users think the Tabbed UI is a lot better than lots of poop-up forms. Even web sites are moving to this Tabbed UI for better usability.
 

Users who are viewing this thread

Back
Top Bottom