Solved

Opening a access mdb with vba

Posted on 2004-04-21
3
1,560 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
[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
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

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.

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…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

617 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