Many form records to many table records

A

Anne

Hi,

I would like to add more than 1 record from my form to a
table. I have written and tested the code to open the
table and I can write 1 record but that's all.

According to Help I can nest with statements, which I have
tried using both the form name and one of the form field
names and still get just one record.

I've also tried to construct a For Each statement but get
hung up on the syntax as it won't accept Me.Fieldname or
Me!Fieldname as the variable.

Once again. Thanks
 
A

Anne

I have a continuous form that lists all of the order
details for a particular order. I've added a button that
lets the user invoice this order. What I want to do is
have the code behind the button add a record to the
invoice header table (1 record) as well as add a record
for each of the order details displayed on the form to the
invoice details table (many records - 1 for each order
detail).

The code I have written so far adds the invoice header
correctly but I can't get any more than one record in the
invoice details table.

VB Help says I can use a For Each or nest With statements
but I 'Think' I am having trouble at the syntax level.

For Each Me!Fieldname or Me.Fieldname in Form is
unacceptable.

Nested With statements may be the better way to go but
again, if I reference either a field within the form or
the form itself I get only 1 record added to the invoice
details table.

Anne
 

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