[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 154
  • Last Modified:

VB6 and Access 2002 problem.

 Hello experts!
  I'm using VB6 and Access 2002 for my database development. In my program, I want to display report and I think Access Report may solve the problem. I search experts-exchange and I find the code:

Public app As Application
Set app = New Access.Application
app.OpenCurrentDatabase "C:\db1.mdb"
app.DoCmd.Maximize
app.DoCmd.OpenReport "EmpReport", acViewPreview

  But nothing happen after I run this code, do you know how to fix this? And, I want the report will be displayed in my App, not in the Access window, how can I do this with VB6 and Access 2002? If at my user machine, only older Access version is installed, will my program run properly?

  Thank you.
0
dttri
Asked:
dttri
  • 3
  • 2
1 Solution
 
Mikal613Commented:
app.DoCmd.Maximize is VBA not vb6
0
 
ALaRivaCommented:
@Mikal,
    Have a look at the code, the person is manipulating Access (via VBA) through VB6, or at least this was the attempt.

@dttri,
    Is your database located in the directory "C:\" with a name of "db1.mdb"?
    Do you have a Report named "EmpReport" in that database?

    As for making the Report open in VB6 and not Access, that's not possible, it has to use Access since it is an Access Report.  Have you considered just using a Data Report in VB6?  Or maybe even Crystal Reports?

-Anthony
0
 
dttriAuthor Commented:
>>Is your database located in the directory "C:\" with a name of "db1.mdb"?
Yes, it is.
>>Do you have a Report named "EmpReport" in that database?
Yes, it have.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
dttriAuthor Commented:
 I also notice that, after run these commands, although Access or report don't appear, I see Access in the Task Manager (process tab). Do you have any suggestion?
  Thank you.
0
 
ALaRivaCommented:
ok, I don't have VB6 in front of me, but it looks like the problem is that you forgot to make the object visible.

It'll be something like this:
app.Visible = True

Put that after the line that opens the Report and you should be fine.

Give that a try and you should see the report come up.

-Anthony
0
 
dttriAuthor Commented:
 Thanks very much! The report appear!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now