[AccessD] open a video file...

Stuart McLachlan stuart at lexacorp.com.pg
Mon Feb 17 05:59:28 CST 2014


Try this:

'' Use double quote to delimit wmplayer path containing a space.
DIm dq as string
dq = chr$(34)  

'Get the file name
fname =  Dir$("F:\Trailers\" & Me.FilmID & ".*")

if fname = "" then 
  `appears a message for file not found
else
  Shell dq & _
       "C:\Program Files (x86)\Windows Media Player\wmplayer.exe" &  _
       dq  & _
      " F:\Trailers\" & fname, vbNormalFocus 
end if 


-- 
Stuart

On 14 Feb 2014 at 19:44, Kostas Konstantinidis wrote:

> hi,
> In a form I use the follown code:
> 
> Private Sub FilmID_DblClick(Cancel As Integer)
> Dim fname, x As String
> fname = "F:\Trailers\" & Me.FilmID & "*"  <- I don´t know if its
> the correct syntax x = IIf(InStrRev([fname], ".") > 0, Mid([fname],
> InStrRev([fname], ".") + 1), "") if fname = "" then `appears a
> message for file not found else Shell "C:\Program Files (x86)\Windows
> Media Player\wmplayer.exe F:\Trailers\fname", vbNormalFocus End Sub
> 
> Every stored file into F:\ Trailers is titled with the same FilmID as
> filename (e.g FilmId = 3070 filename = 3070.mp4) but the extensions
> may be different while some files are saved as .mp4 some as .avi and
> some others as .flv etc rtc... When Shell() calls wmplayer, it opens
> but it can't play the file because obviously it can't find it...
> 
> Thank you for any help
> 
> /kostas
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com




More information about the AccessD mailing list