i want to write code instead of usingreport for print data in acce

G

Guest

Please help me i want to print query throught code because i want to need
some loop and conditions for print data ! thanks in advance
 
D

Duane Hookom

What have you tried? Do you know how to create a recordset and loop through
it?

You can use the Print method within a report to print values on the report.
 
G

Guest

I'll give an example of how to use code to print reports, I hope it will help
A table with two fields containing a report name and a criteria

dim MyDB as database, MyRec as recordset
set MyDB=codedb
set MyRec=mydb.openrecordset("Select ReportName, Criteria From ReportTable")
While not myrec.eof
docmd.openreport MyRec!ReportName, , , MyRec!Criteria
myrec.movenext
wend
 

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