Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

access 2000 et visual basic

Posted on 2003-03-18
14
Medium Priority
?
151 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
  • 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
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!

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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 Month15 days, 1 hour left to enroll

577 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