Variable RunApp

K

Kevbro7189

I have a table with a list of over 10,000 files. The table doesn’t contain a
location or file extention. I want a macro to open a specific file when a
button next to the name is clicked on. Below is the Macro I have come up
with so far. [Text6] populates automatically with the name of the file when
the associated button is clicked.

Macro
SetTempVar
Name: PRTOPEN
Expression: [Forms]![Table1]![Text6]

RunApp
Command Line: "C:\ winword.exe" "C:\†[TempVars]![PRTOPEN] ".doc"

RemoveAllTempVars
 
S

Steve Schapel

Kevbro,

I have no idea whether this will work or not. Give it a go...

SetTempVar
Name: PRTOPEN
Expression: """" & "C:\ winword.exe" & """" & " " & """" & "C:\†& [Text6] &
".doc" & """"

RunApp
Command Line: [TempVars]![PRTOPEN]

RemoveAllTempVars
 
K

Kevbro7189

Nop it's treating [PRTOPEN] as text and not a value.


Steve Schapel said:
Kevbro,

I have no idea whether this will work or not. Give it a go...

SetTempVar
Name: PRTOPEN
Expression: """" & "C:\ winword.exe" & """" & " " & """" & "C:\†& [Text6] &
".doc" & """"

RunApp
Command Line: [TempVars]![PRTOPEN]

RemoveAllTempVars

--

Steve Schapel, Microsoft Access MVP


Kevbro7189 said:
I have a table with a list of over 10,000 files. The table doesn’t
contain a
location or file extention. I want a macro to open a specific file when a
button next to the name is clicked on. Below is the Macro I have come up
with so far. [Text6] populates automatically with the name of the file
when
the associated button is clicked.

Macro
SetTempVar
Name: PRTOPEN
Expression: [Forms]![Table1]![Text6]

RunApp
Command Line: "C:\ winword.exe" "C:\†[TempVars]![PRTOPEN] ".doc"

RemoveAllTempVars
 
S

Steve Schapel

Kevbro,

Another shot in the dark... Try putting an = sign in front of it, in the
RunApp...
Command Line: =[TempVars]![PRTOPEN]
 
K

Kevbro7189

I’ve tried different variations of this but when it comes to RunApp, it just
doesn’t want to look at the SetRempVar as a value. If anyone has ANY ideas

Macro
SetTempVar - WORKS
Name: PRTOPEN
Expression: [Forms]![Table1]![File] ----- The data is the file
I want to open

SetTempVar - WORKS
Name: PRT1
Expression:
"C:\Users\Kevin \Documents\" & [TempVars]![PRTOPEN] & ".doc" -----This sets
the location

SetValue - WORKS
Item: [Forms]![Table1]![Text6]
Expression:
[TempVars]![PRT1] ------- This checks the output , the location and file
are put together correctly

RunApp -ISSUES
Command Line: "C:\Program Files\Microsoft Office\Office12\winword.exe"
=[TempVars]![PRT1]

------ Word opens but the file does not.
The error message is:
“The File could not be found (C:\user\...\=[TempVars]![PRT1].doc)â€

RemoveAllTempVars


Steve Schapel said:
Kevbro,

Another shot in the dark... Try putting an = sign in front of it, in the
RunApp...
Command Line: =[TempVars]![PRTOPEN]

--

Steve Schapel, Microsoft Access MVP


Kevbro7189 said:
Nop it's treating [PRTOPEN] as text and not a value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top