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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referring to text box for file location to open PDF file 1

Status
Not open for further replies.

MDJ52

MIS
Mar 30, 2001
120
US
Below is a copy of code that allows me to open a PDF by pressing a button on my form.
What I would like to do is refer to a text box that will reference a field in my table, that will give the name of the file.
This will mean that I will need to somehow put the reference to the text box within the 2nd set of quotes.
Thanks for any help.

Private Sub Command0_Click()
On Error GoTo Err_Command0_Click

Dim stAppName As String

stAppName = "c:\program files\adobe\acrobat 4.0\reader\acrord32.exe ""f:\mbkup\pdf\100.pdf"
Call Shell(stAppName, 1)

Exit_Command0_Click:
Exit Sub

Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click

End Sub
 
Try this:

stAppName = "c:\program files\adobe\acrobat 4.0\reader\acrord32.exe ""f:\mbkup\pdf\" & txtWithFileName
Call Shell(stAppName, 1)

HTH Joe Miller
joe.miller@flotech.net
 
Your solution worked like a champ. I was trying to make it too difficult by referring to forms or using 'me!'
Thanks for the help.
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top