This function outputs a recordset as a series of forms.
FormADO(docXML As DOMDocument, rsRecordset As ADODB.Recordset)
docXML XML definition of Form
This method adds a copy of the form for every row in the recordset. If there is insufficient room on the page for the next record, a new page is added using AddPageTemplate thus preserving any general format of subsequent pages.
The xml file must contain definitions of a form as produced by ReadForm. The form is completed with data taken from the recordset row in a manner similar to FormDisplay. A param collection is created based on the field names of oRecordset which are then matched to the names of any TextBox controls on the form.
To output a recordset using a form definition:
sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db1.mdb;Persist Security Info=False"
oRecordset.Open "table1", oConnection
Set xml = Preview.ReadForm("C:\form3.frm")
Preview.AddPage "0.5 in", "4.0 in", "0.5 in", "1.0 in", ".75 in", "1.0 in"
Preview.FormADO xml, oRecordset
Come and visit :