Accessing Access report via VB 
Author Message
 Accessing Access report via VB

I have designed a number of reports in an Access 97/2000 database.  I
would like to run these reports via VB 6.0.  For example I would
design some type of report module in the VB app that allows the user
to enter a selection criteria and run the report.

Any help on this would be great.

Thanks

Matt



Tue, 27 Apr 2004 05:53:11 GMT  
 Accessing Access report via VB
Your question has been discussed here last month here. If you can search
posts of this group on Oct. 9 to Oct 12 on subject "VB6 Frontend - Access
2002 Displaying Reports".

In case you don't find it, here is the copy of my first post to the question
(between 2 "********" lines):

**********************************************************

It seems that the database you are using is Access. With Access you can
design a better report than what you can with Data Report, coming with VB.
Unless your report is very simple, or you don't mind if it looks not so
great.

In your case, you have reports pre-built in Access and you want the report's
RecordSource can be changed dynamically in a VB program. Yes, it is doable.
Set reference to Access object library in your VB project, then you can
manipulate Access report object from VB project.

Tip:

If you want dynamically Report's desgn in Access from VB code, you need open
the report in design view first, then open it in preview view or normal
(printing) view. The codes looks like:

Dim appAccess as Access.Application
set appAccess=Getobject("Access.Application") ' OR
CreateObject("Access.Application")
......

appAccess.DoCmd.OpenReport "myReport", acViewDesign
......
'Do some report change
......
appAccess.DoCmd.OpenReport "myReport", acViewPreview  'OR acViewNormal
......


Quote:
> Hi all,

>   I have built queries in Access that require the user to supply
> information.  I have tried to open the reports (that are based on those
> queries) directly from within VB to no avail, so I translated my queries
to
> SQL and added a new Command to my Data Enviroment to base a Data Report in
> VB on.
> Now when I run my query it halts stating that the information I am
> requesting from the user has no default value.  It seems to me that SQL is
> treating my prompt as a variable.

> My questions are these:

> Is there any way to prompt the user for the required data that my queries
> require from VB so that I can call my Access reports and display them to
> the user upon request?

> Is it a better idea to use my SQL command in Data Enviroment to run the
> queries and design my reports in VB - Data Reports?

> If it IS a better idea to use Data Reports how do I prompt a user for data
> in SQL in order to supply my query with the data it requires to execute?

> I'd be happy to supply any information that you may require to help me
> resolve this problem.

> Any help would be greatly appreciated,
> Bent

***********************************************************


- Show quoted text -

Quote:
> I have designed a number of reports in an Access 97/2000 database.  I
> would like to run these reports via VB 6.0.  For example I would
> design some type of report module in the VB app that allows the user
> to enter a selection criteria and run the report.

> Any help on this would be great.

> Thanks

> Matt



Tue, 27 Apr 2004 07:09:49 GMT  
 Accessing Access report via VB
Hehe, I figured you'd jump on this one Norm, looks vaguely familiar ;) BTW
all is running happy now.

Bent



Quote:
> Your question has been discussed here last month here. If you can search
> posts of this group on Oct. 9 to Oct 12 on subject "VB6 Frontend - Access
> 2002 Displaying Reports".

> In case you don't find it, here is the copy of my first post to the
question
> (between 2 "********" lines):

> **********************************************************



Tue, 27 Apr 2004 22:37:48 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VB to Execute Access Report - Access report displayed on Web

2. Print Access Reports via VB

3. VB 4.0, Crystal Reports and Access via ODBC

4. Print Access Reports via VB OLE

5. VB 4.0, Crystal Reports and Access via ODBC

6. Access report via VB code

7. VB 4.0, Crystal Reports and Access via ODBC

8. Emailing an Access Report via VB!

9. Access report via VB code

10. Accessing encrypted data in Access 2000 DB via VB

11. Accessing MS access reports through VB .net

12. Can I access MS Access Reports From VB?

 

 
Powered by phpBB® Forum Software