PrintRepDef



Dim SQL$
Dim db as DataBase
Dim rs as recordset
Dim dummy1, dummy2
Set db = OpenDatabase([yourdatabasename])
SQL$ = "SELECT * FROM " & [yourtablename]
Set rs = db.OpenRecordset(SQL$)
dummy1 = ""
dummy2 = ""
Do While Not rs.EOF
If rs.Fields(0).Value <> dummy1 Then
'print PMC once

Printer.Print rs.Fields(0).Value
dummy1 = rs.Fields(0).Value
End If
If rs.Fields(1).Value <> dummy2 Then
'print PSC once

Printer.Print Tab(10); rs.Fields(1).Value
dummy2 = rs.Fields(1).Value
End If
'print PI, PN, QH

Printer.Print Tab(15); rs.Fields(2).Value; _
Tab(45); rs.Fields(3).Value; _
Tab(75); rs.Fields(4).Value;
rs.Movenext
Loop
Printer.EndDoc
rs.Close
db.Close
'So if the items are NOT in the same table you have to change the SQL$ so that

'the result is always a overview of the contents of all the tables.


(printrepdef.html)- by Paolo Puglisi - Modifica del 25/3/2019