Subform question

C

Chad

I have a form (Form1) that contains a subform (Subform1).

Within this subform I have a combo box which, depending on what is chosen,
pops up another form (Popup1)for additional information. I need this
additional information in the form that pops up to be 'linked' with the
subform.

The problem I am running into is that when the user enters information in
Popup1, the table has not been populated witht he data that is in the subform
so there is no record to 'link' to. What is the best way to force te
esubform to pass its information to the table?

Thanks in advance
 
J

Jeff Boyce

Chad

It all starts with the data ... and you're describing forms ...

Where are you keeping your data? In the same Access file as the forms? In
a "split" Access ("back-end") file? In a SQL-Server database?

In the first two situations, I believe that as soon as you "dirty" the
subform record, you are writing to the table behind the subform. Note that
this is based on two assumptions: 1) your subform is bound to an underlying
table/query; 2) the combobox that pops up the additional form is NOT the
first field used on the subform.

You haven't described your data and structure. If you provide a bit more
specific description, folks here may be able to offer a bit more specific
suggestions.

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
J

John W. Vinson

The problem I am running into is that when the user enters information in
Popup1, the table has not been populated witht he data that is in the subform
so there is no record to 'link' to. What is the best way to force te
esubform to pass its information to the table?

In the code which pops up the form, include the line

If Me.Dirty Then Me.Dirty = False

before the openform step.
 
C

Chad

Thank you for your response Jeff. I apologize for the lack of information,
hopefully the following will help:
************************************************************

I have a form (Form1) which uses Table1 as its source. Form1 contains a
subform (Subform1) which uses Table2 as its source. The Subform is a single
form data entry form used to populate a table which has a one-to-many
relationship with the table that is source table of the main form (Form1)

Within this subform I have a combo box which, depending on what is chosen,
pops up another form (Popup1) for additional information. This popup form
is unbound but will be used to populate a table (Table3)that has a one to
many relationship with the source table of Subform1 (Table2) through a query.


The problem I am running into is that when the user enters information in
Popup1, the Table2 has not been populated with he data that is in the subform
so there is no record to relate to when running the query to populate
Table3. What is the best way to force the subform to pass its information to
the table?

Thanks again, I hope this is more clear.
 
J

Jeff Boyce

Chad

I believe John V's offered a way to ensure that the subform record is saved
before moving on to the pop-up form.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 

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