Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Opening a access mdb with vba

Posted on 2004-04-21
3
Medium Priority
?
1,572 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 200 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

783 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