K
Kevbro7189
I have a table with a list of over 10,000 files. The table doesn’t contain a
location or file extension just the basic file name. I made a form to list
all the files. Next to each line I want a button to run macro to open the
specific file based on the data stored in the table. Below is the Macro I
have come up with so far. [Text6] populates automatically with the name of
the file in its proper file location when the button is clicked.
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
location or file extension just the basic file name. I made a form to list
all the files. Next to each line I want a button to run macro to open the
specific file based on the data stored in the table. Below is the Macro I
have come up with so far. [Text6] populates automatically with the name of
the file in its proper file location when the button is clicked.
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