For example i have table in access that has name, address and email fields
I want print out that in report using vba when a command button is clicked .
I be happy if some one show me how.Thanks
Printable View
For example i have table in access that has name, address and email fields
I want print out that in report using vba when a command button is clicked .
I be happy if some one show me how.Thanks
You can use the DoCmd in Access using the OpenReport method.
VB Code:
Application.DoCmd.OpenReport "Report1", acViewPreview, , , acWindowNormal
Thank u reply. Well i want the vba to generate teh report1 not myself. I want the vba to generate and laod the report. i be happy if u show me a working example. ThanksQuote:
Originally Posted by RobDog888
You can generate a query that returns information that can be fed into a report, but you have to create the report form first.
This is true with Access or Crystal Reports or any other reporting tool I've dealt with.
Trust me when I say, its allot easier to manually create the report first like Hack stated, but you can create
the report via code. Its usually not worth it though. The positioning of the controls alone are a headach since
you can not see where they are until you test or preview.
even if you create a template report to facilitate this it would save a lot of pain :)
e.g. put all of your text boxes in place, but do not associate data sources until you generate the report