473,396 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Open other access database from button inside access database

Hi,

I've created an access 2003 database that has a form with button called "open complaint database." This complaint database is also in access 2003. Here is my code to open the complaint database

Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdOpenDb_Click()
  2.        Dim objAccess As Access.Application
  3.  
  4.          ' Open Access database
  5.          Set objAccess = CreateObject("Access.Application")
  6.          With objAccess
  7.             ' Make the application visible.
  8.             .Visible = True
  9.             ' Open the complaint database.
  10.             .OpenCurrentDatabase ("C:\complaint_2003.mdb"), False
  11.             Set objAccess = Nothing
  12.      End With
  13.      Exit Sub
  14. End Sub
when I click the button, I get this error "Microsoft office access has encountered a problem and need to be close. We are sorry for the incovenience" with send error report and don't send buttons.

I tested this code using access 97 to open another access 97 and it worked perfectly. Can anyone please help me on how to open access 2003 database from another access 2003, because I need to convert all my access 97 databases to access 2003?

Thank you in advance.
Oct 4 '07 #1
3 3759
Scott Price
1,384 Expert 1GB
Hi, I'm using Access 2003 also, and copying and pasting your code (with the one change of making the path point to a valid database on my computer) works just fine!

Check your references to make sure all are where they should be:

I've got these six selected:

Visual Basic for Applications
Microsoft Access 11.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft ActiveX Data Objects 2.1 Library
Microsoft Office 12.0 Object Library

Other than that, I would say you've got a possibly corrupted database, or a possibly corrupted install of Access.

This is a link to Allen Browne's website with suggestions on Recovering Corruption , and Preventing Corruption .

Regards,
Scott
Oct 4 '07 #2
Hi, I'm using Access 2003 also, and copying and pasting your code (with the one change of making the path point to a valid database on my computer) works just fine!

Check your references to make sure all are where they should be:

I've got these six selected:

Visual Basic for Applications
Microsoft Access 11.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft ActiveX Data Objects 2.1 Library
Microsoft Office 12.0 Object Library

Other than that, I would say you've got a possibly corrupted database, or a possibly corrupted install of Access.

This is a link to Allen Browne's website with suggestions on Recovering Corruption , and Preventing Corruption .

Regards,
Scott
Thank you for the reply and yes it was my access installation problem. Once I reinstalled office it's working fine.
Oct 5 '07 #3
Scott Price
1,384 Expert 1GB
Glad you got it working! Thanks for posting back with the solution.

Regards,
Scott
Oct 5 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Arsene Lupin | last post by:
Is there a way to have Microsoft Access XP automatically display all table views, etc., in a maximized screen when Access is started? It is extremely time consuming to have to maximize the viewing...
2
by: plau011 | last post by:
Hello Access gurus, I am curious as to why you can't open an Access 2003 Db with Access 2000. We have a Visual Basic application which is using DAO 3.6 to connect to the Access database. It IS...
1
by: Neil | last post by:
Hi, I have a database that's been developed in Access 2000. On clicking the database icon, the datbase moves straight to a switchboard. For coding I press the shift button while starting the...
1
by: simplengrichard | last post by:
Hi everyone! I need some help. I placed a webform table and then I added other controls within the cell such as dropdown box and buttons, etc. I was wondering if it is possible to access this...
2
jaccess
by: jaccess | last post by:
I was wondering if there is a simple way to open a specific folder from an access form button. I have a form that a user can enter a date range and either view or print reports based on the date...
0
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of...
5
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of...
1
by: semomaniz | last post by:
I have a button inside a repeater which is supposed to open a popup when clicked. But when i click on the button my modalpopup does not open. The strange thing is on the code provided below if i...
2
Breeves22
by: Breeves22 | last post by:
Hi all I have no idea if this is possible and doing a general search on the internet yeilded no results so i thought i would ask here. In the database i am creating there will be a need to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.