Getting data from a subform into an Excel template

G

Guest

I have an Orders form with OrderDetail in a subform - the data source for the
subform is a Select Query of Orders and OrderDetail tables.
I have a "Print Invoice" button on the Orders form which opens an Excel
template. I can successfully populate the header info (customer/Order No etc)
of the template, and can even populate the first line of the invoice detail
(product, description, unit cost) with the data from the first record of the
sub form - in fact I can populate as many Invoice Detail lines as there are
records in the subform - but each invoice detail line is only the data from
the first subform record.

What I cannot figure out - despite much reading here and elsewhere - is how
to programatically (VB code) access each subform record in turn. Any help
appreciated!
 
G

Guest

Sorted!
I used [Forms]![Orders]![OrderDetail].Form.Recordset.AbsolutePosition
and I can manipulate that from within my code...
....so 4 days of research (on and off), give up, post and hey presto - it's
magic!
Sorry for wasting your time
 

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