Getting data from a subform into an Excel template

  • Thread starter Thread starter Guest
  • Start date Start date
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!
 
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
 
Back
Top