Stop message popups

MCantu

Registered User.
Local time
Today, 08:57
Joined
Nov 18, 2004
Messages
62
What I need to do:
I am trying to use a desktop macro program in conjunction with access.
The macro program it's self is not that versatile, so I plan to have access "Make decisions" on which desktop macro to run based upon logic in VB.

What I wanted access to do:
I want access to trigger the macro every time it does NOT encounter a new record.
Simple enough, right?

DoCmd.GoToRecord , , acNext
If Me.NewRecord = True Then

Else
'Activate my macro program here
End If

Here is the problem.
I tried to use the shell command, tried it a hundred different ways, I always got an "argument" message from access. I gave up.


I thought, hey, I'll get it up with a hyperlink!


Dim ctl As CommandButton
Set ctl = Me!Command6
With ctl

.HyperlinkAddress = "C:\Program Files\Workspace Macro Pro 6.0\My Macros\test.wksp"
.Hyperlink.Follow
End With



This does bring up the macro program... however I get this popup:

---------------------------
Microsoft Office
---------------------------
Opening C:\Program Files\Workspace Macro Pro 6.0\My Macros\test.wksp

Some files can contain viruses or otherwise be harmful to your computer.
It is important to be certain that this file is from a trustworthy source.

Would you like to open this file?


---------------------------
OK Cancel
---------------------------


This puts a damper on the automation and stops the process cold.


"DoCmd.SetWarnings False" does not work

I already have turned off my confirmation popups under "tools/options/edit/find" unclicked the 3.

I still have the popup.

If I can avoid this popup, my plan looks like it may work with a hyperlink.


BTW, this is the shell I tried, I used this code for another access database, worked fine there, but I swap out the path with my macro, and it doesn't work.

Dim Apname As String
Apname = Shell("C:\Qik\app\Desktop.exe", vbMaximizedFocus)

I use windows task scheduler to activate the macros directly, and they activate when you click on them, so why can't you call shell them?


If anyone can suggest anything to stop the popup or change the shell so it will work, I am all ears.

Thanks!
 
I prefer to use the ShellExecute method to open a file. It does not have the problems that the Shell() function does [as you have discovered].

I have a working example in my Browse [Find a directory or file] sample.
 
could not find example

I downloaded the database in your example. I could not find an example of the ShellExecute method
 
How hard did you look? :rolleyes:

The dOpen module contains the OpenFile() function which uses the ShellExecute() method to open a file.

The fFindOpenImportFile form uses the OpenFile() function in the OnClick event of the bOpenFile command button.
 
duh

sorry I was only looking at the VB on the forms.
 

Users who are viewing this thread

Back
Top Bottom