Store pop-up form details for main form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a main form and a pop-up form which needs to be linked somehow.
The pop-up form is being used to add information, and the main form is also
used to add information and both forms details need to be added to 1 table.

The main form has all the questions which need to be answered plus it has
the function to enter a suppliers detials however if there are
multiple suppliers then a button is pressed on the main from which brings up
the popup form where the additional supplier details can be entered.
Once the details are completed on the pop-up form a button is clicked on
which needs to take the user back to the main form so they can complete
ansering the questions.

I need to know how to save the pop-up form and store the details until the
main form has been completed and a submit button is clicked on which is on
the main form.

I hope the above makes sense.

Thanks again
 
Rather than savint the data from the popup form in a temp table, why not save
the current form record prior to opening the popup form?
DoCmd.RunCommand acCmdSaveRecord
 
Hi Pat
Iif I save the main form can I add the addition details from the mainform
which need to be completed after the additional supplier details have been
added and if so how do I save the pop-up form into the table.

Thanks
 
How about a different approach -----------
Put a tab control with two pags on your main form. Label page 1 as primary
supplier and page 2 as additional suppliers. Move what you have on the main
form to page 1 and move what you have on the pop-up to page 2. Then it's
just a click on page 2 tab to enter multiple suppliers.
 
As I reread your original post it seems that you have not properly normalized
your tables. You have a many-to-many relationship to supplier. By storing
one supplier in your main table, you have not only de-normalized your
structure but you have also made more work for yourself. Use a subform for
ALL the suppliers or use a tab control as PC Datasheet recommended.

As long as your forms are bound to tables or queries (preferable), Access
will take care of saving the data whenever it is necessary.

If you stick with a popup form, you MUST save the mainform prior to opening
the popup AND you must provide the foreign key value yourself. Access can't
do it for you as it does with subforms. Use the BeforeInsert event of the
popup for to avoid undesirable side effects.

Me.MainFormKey = Forms!MainformName!MainFormKey
 
Back
Top