Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running another app with Access form button

Status
Not open for further replies.

lalato

Technical User
Aug 9, 2001
44
0
0
US
I have been trying to run another app from an Access for button, but it's not working as I would like it.

I can get the app to open using Shell, but I can't seem to control it in any way. I've tried AppActivate and SendKeys, but it doesn't seem to work. All of my keystrokes stay in Access instead of going to the other app.

Is it possible to perhaps run a batch file or some other script that will run the outside program and do the things I need done outside of Access. If so, does anyone have any scripting programs or macro programs they can recommend that would do the trick?

Or does anyone have any tips for controlling other apps from Access using VBA?

Thanks,
--sam
 
WHat application u want to run?

u can use the RunApp action from the macro object
 
Which types of applications are you trying to run? If you search through the forums here you can find an example of how to send commands to almost any application you would need.

If it's microsoft products you're using as long as you have their object library selected under "References" (I can tell you how to do this is you like) you can send specific comands to do almost anything you would want.

e.g.:
Dim ProjObj As MSProject.Application
Set ProjObj = CreateObject("msproject.application")

ProjObj.FileOpen "FileName", ReadOnly:=False
ProjObj.Visible = True

ProjObj.Macro "MacroName"
ProjObj.Macro "OtherMacroName"

This simple example above will open up a specific project in MS Project and run two macros that are in MS Project.

You can do all sorts of things with Word, Excel, Project, Powerpoint. And also with other things like AS400 or whatever.

Let me know what you're trying to run and I'll see if I can't help more.

Kyle ::)
 
Thanks Kyle. I'm trying to run an AS/400 Data Transfer from Access.

I can setup the Data Transfer to run automatically when it is called, but the trick is that I need to update the SQL statement in the Data Transfer file with a date/number I enter into an Access form.

So far I can open the AS/400 Data Transfer, but no other commands seem to be going to Data Transfer.

I would do a pass-through query to pull the same data, but performance is super duper slow using pass-through. I've found that the AS/400 Data Transfer is much faster. All I need to do is automate it so the end-user will not have any problems.

This is also exacerbated by the fact that I'm an Access novice.

Thanks again,
--sam
 
There was a thread today that discussed using ADO to connect to an AS400 system and run a query to get the desired recordset (all from Access). Definitely take a look and see if it helps.

It is: thread705-178402

Unfortuneately I haven't worked with Access/AS400 comunication, so I won't be of any help. Take a look through some of the posts using the advanced search and see what you come up with, or maybe one of our esteemed collegues knows what to do...?

Sorry...and good luck!

Kyle ::)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top