Solved Open Application using location from form field (1 Viewer)

jbk_075

New member
Local time
Today, 11:13
Joined
Oct 22, 2021
Messages
3
Please excuse my ignorance but I'm new to this part of Access...

I was to click a button that will open a media player using the data in a field on the form as the file to open.

The DOS command would be: "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" "c:\movies\a\2012.mp4"

I have the following in Access:


Private Sub cmd_PlayMovie_Click()

Dim stAppName As String

stAppName = "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe"

Call Shell(stAppName, 1)

End Sub


This opens the player but how do I open the file name stored in the Form Field [DigitalLocation].

Any help would be greatly appreciated.

Jason
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:13
Joined
Oct 29, 2018
Messages
21,469
Hi Jason,

Welcome to AWF!

Maybe you could try using something like:

Code:
strAppName = """C:\Program Files (x86)\VideoLAN\VLC\vlc.exe"" ""c:\movies\a\2012.mp4"""
 

jbk_075

New member
Local time
Today, 11:13
Joined
Oct 22, 2021
Messages
3
Thanks, but the name (location) is different for each record. There are 2000 records. I would like to click on the "Play" button on the form with a record loaded. The data is located in the table under the "DigitalLocation" field.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:13
Joined
Oct 29, 2018
Messages
21,469
Thanks, but the name (location) is different for each record. There are 2000 records. I would like to click on the "Play" button on the form with a record loaded. The data is located in the table under the "DigitalLocation" field.
In that case, you could try it this way:

Code:
strAppName = """C:\Program Files (x86)\VideoLAN\VLC\vlc.exe"" """ & [DigitalLocation] & """"
 

Users who are viewing this thread

Top Bottom