?
Solved

access 2000 et visual basic

Posted on 2003-03-18
14
Medium Priority
?
150 Views
Last Modified: 2013-12-25
I converted my access 97 database to access 2000, when I try to open a report with access 2000, it work fine, but with Visual Basic, the access windows open, but the report doesn't.

(I have VB 6.0 with Service Pack 5, I have the reference to the Access 9.0 object library in my application. All my application work fine, exepct for open a report.)

My code :

Dim acApp As Object
Set acApp = CreateObject("Access.Application.9" )
Dim path As String
path = CurDir & "\db.mdb"
With acApp
.OpenCurrentDatabase path
.DoCmd.OpenReport "report1", acViewPreview
End With
Set acApp = Nothing

please help!!!!!!!
0
Comment
Question by:jfmcduff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
  • 2
14 Comments
 
LVL 7

Expert Comment

by:fluglash
ID: 8160171
what error do you get?
0
 

Author Comment

by:jfmcduff
ID: 8160189
I have no error, the access windows open, but the report doesn't open.
0
 

Author Comment

by:jfmcduff
ID: 8160200
I have no error, the access windows open, but the report doesn't open.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 7

Expert Comment

by:fluglash
ID: 8160284
are you sure the report is there?
0
 

Author Comment

by:jfmcduff
ID: 8160609
yes, my application work fine with access 97, bu after i converted it to access 2000, all my report doesn't open with visual basic.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 8161016
Change acViewPreview for its numerical value (1 I think).
0
 

Author Comment

by:jfmcduff
ID: 8161127
tanks, but Change acViewPreview for its numerical value, don't work
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 8161179
change
Set acApp = CreateObject("Access.Application.9" )

to
Set acApp = CreateObject("Access.Application" )
0
 

Author Comment

by:jfmcduff
ID: 8161225
tanks but it don't work :(
I have selected the Access 9.0 object library and DAO 3.6, Do i Need other librairy?
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 8161255
remove Set acApp = Nothing
0
 

Author Comment

by:jfmcduff
ID: 8161311
tanks but it don't work :(
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 8161392
change CurDir
for app.path

if still not working, you can send a small test (zip containing vb + mdb) to emoreau99@hotmail.com
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 300 total points
ID: 8161786
Ouch!

After creating the instance, set it visible!
    acApp.Visible = True
0
 

Author Comment

by:jfmcduff
ID: 8162073
cooolllll :P tanks you
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month9 days, 21 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question