I created a simple db with one table and one form in it. The form contains Media Player details section. And I placed a combo at page header area of the form. The table contains only 3 field : No, TrackTitle & Location with number & text field type.
What I need is: If I select any track from the combo (which is doing already), the selected track should get into media player and run. The path of the track is already mentioned in the table.
The purpose is I dont want someone to know where tracks are located and runing from except viewing media player.
I have attached my db for your ready ref. Please let me know if someone could help me out as I am stuck up at this point....
With your [CboSearchTrack] I would suggest you specify the rowsource when you load the form. If you do this via the form it will allow you greater flexibility so in your form open event add in:
Here is the code to get it working. Hopefully you can learn more (do a search on the media player). Try adjusting the cbo to have three fields so the song name is just displayed so when the user selects it the actual location is not displayed (you will still need to pass the url or full pathname to the media player).
PS I have a cataloger/player program which may be of use to you but it is 1.6MB in size so if you send me an email I will post it to you. It has everything you will need plus a lot more (i.e. a cataloger searcher ID3 tag stuff).
Private Sub CboSearchTrack_AfterUpdate()
Public Sub sPlayFile(slocation As String)
On Error GoTo err_trap
Me.WindowsMediaPlayer0.Object.URL = slocation
Me.WindowsMediaPlayer0.Object.settings.autoStart = True
Me.WindowsMediaPlayer0.Object.settings.enableError Dialogs = True
DoEvents ' Will release so you can do other things
MsgBox ("Error: " & Err.Number & vbCrLf & Err.Description)
Me.CboSearchTrack.RowSource = "SELECT tracklocation FROM T_Track_Master;"
Private Sub Form_Open(Cancel As Integer)
The player and the original DB I posted seem to work for me.
The references I have used include
Visual Basic for Applications,
MS Access 12 object library,
OLE Automation, and
Windows Media Player.
I have attached another slighly amended version of the data base using some of my songs so you can see how to select (note these have to come from a defined areas so you will need to amend the table contents.
In regard to your previous enquiry using strfilter i would suggest that you simply use a statement that looks at the end characters after the "." and if MP3 or movie etc direct to player else use the shell command to open/execute the other files. You could also add another field to the table which hold the file type and add another Dlookup to determine what to do with it. This depends on what you want to achieve from your project.
Good luck and let me know what you decide to do and if you modify my code (or make it better) please let me know and possibly send me a copy etc.