Solved

Opening a access mdb with vba

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
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…

752 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