|
-
May 1st, 2005, 03:02 PM
#1
Thread Starter
Frenzied Member
How to generate a report using vba ?
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
-
May 1st, 2005, 08:17 PM
#2
Re: How to generate a report using vba ?
You can use the DoCmd in Access using the OpenReport method.
VB Code:
Application.DoCmd.OpenReport "Report1", acViewPreview, , , acWindowNormal
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 2nd, 2005, 04:55 AM
#3
Thread Starter
Frenzied Member
Re: How to generate a report using vba ?
 Originally Posted by RobDog888
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. Thanks
-
May 2nd, 2005, 06:19 AM
#4
Re: How to generate a report using vba ?
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.
-
May 2nd, 2005, 10:44 AM
#5
Re: How to generate a report using vba ?
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 2nd, 2005, 02:03 PM
#6
Addicted Member
Re: How to generate a report using vba ?
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
if you fail to plan, you plan to fail
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|