Solved

Opening a access mdb with vba

Posted on 2004-04-21
3
1,552 Views
Last Modified: 2010-05-18
Hi all,

I'm trying to call another access mdb on a commandbutton_click()
Synatx as follows:

stAppName = "C:\Project\Inventory.mdb"
Call Shell(stAppName, 1)

This throws me an error "Invalid procedure call or argument".
If I were to change to this,

stAppName = "Access.exe C:\Project\Inventory.mdb"

It tells me file not found. Suggestions please?

Xhenkaii
0
Comment
Question by:xhenkaii
3 Comments
 
LVL 6

Accepted Solution

by:
nathaniel earned 50 total points
ID: 10884848
try this one,

sub openthefile
   dim stAppName
   stAppName = Shell("msaccess.exe C:\Project\Inventory.mdb",1)
end sub

in calling the procedure:
type: call openthefile

hope this helps,
0
 
LVL 34

Expert Comment

by:flavo
ID: 10884871
Shell ("C:\Program Files\Microsoft Office\Office\Msaccess.exe C:\Project\Inventory.mdb",1)
0
 

Author Comment

by:xhenkaii
ID: 10885073
Thanks guys.

I'll accept nlhizon ans as he was first and it works.

Xhenkaii
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

820 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