Appending a table from a form

A

a.t.brooks

Hi Guys,
I have an annoying problem and I hope you can help.
I have a db with two tables. There is a one-to-many relationship
between them with the one field being a PK autonumber on the primary
table.
I would like to create a form from the primary table with a command
button which automatically appends or creates an entry the linking
field in the 2nd many table.
i.e. If I start entering data in the primary form, the PK autonumber is
generated. Then I want to click a button which;
(a) creates an entry on the 2nd table with the same number which is the
PK of the primary
(b) opens a new form for the 2nd table showing the record with that
number. I know how to do this
(c) close the primary table. I know how to do this.

So, I would open up the primary table and start entering data. The PK
for that record would then automatically be generated. When I'm done, I
would like to click a button which takes me to the 2nd "many" form,
where I can enter data and have it automatically linked to primary
record.

There would then be another button on the 2nd table which would create
a new record with the same ID again. Thus, a one-to-many relationship

I know I can do something similar with a sub form, but I would like to
use this technique to create a cascade of forms as I have so much info
to put in it wouldn't fit on the 55" of the standard form.

Thanks in advance.
Tony
 
K

kingston via AccessMonster.com

If I understand correctly, you can use a subform that has the data grouped
via tabs. If you have a lot of fields in the subform, you might consider
using the datasheet view too. Using subforms seems to be the correct
approach. It just sounds like you need to settle on a way to display the
subform.
 
A

a.t.brooks

I know I can use sub-forms. It's just that I don't particularly want to
use them. I would prefer a cascade of forms. i.e. fill out first form,
hit next to go to the next part..and so on.
I was thinking if I could get the append query to work, then I'd be in
business.

Playing around, another issue with it is that it adds multiple records
when I only want to add one as it gets the info from the table and not
the form.
 
K

kingston via AccessMonster.com

I still think that you can use subforms and a tab control to do exactly what
you're describing. Each tab would hold some of the fields and you can create
a button to go to the next tab if you want.

Records generally are created one at a time in a subform. It's not clear why
you get multiple records. I suggest you test the different display options
for the subform: single, continuous, and datasheet.
 

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