Page 1 of 2 12 LastLast
Results 1 to 15 of 30
  1. #1
    Join Date
    Jan 2005
    Location
    Nanded, India
    Posts
    397

    Unanswered: Pick up track from specific dir

    Hi,

    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....

    Thanks,
    Attached Files Attached Files
    With kind regards,
    Ashfaque

  2. #2
    Join Date
    Jan 2005
    Location
    Nanded, India
    Posts
    397
    Hi,

    Anyone there to help me about my track db?

    Please extend your help.....
    With kind regards,
    Ashfaque

  3. #3
    Join Date
    Nov 2008
    Posts
    24
    Hi,
    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).

    Regards
    Tony

    Private Sub CboSearchTrack_AfterUpdate()
    Call sPlayFile(Me.CboSearchTrack.Column(0))
    End Sub
    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
    Exit Sub
    err_trap:
    MsgBox ("Error: " & Err.Number & vbCrLf & Err.Description)
    Exit Sub
    End Sub
    Function ReloadTrack()
    Me.CboSearchTrack.RowSource = "SELECT tracklocation FROM T_Track_Master;"
    End Function

    Private Sub Form_Open(Cancel As Integer)
    Call ReloadTrack
    End Sub

  4. #4
    Join Date
    Nov 2008
    Posts
    24

    reply to media track player

    I had a go at adding etc so here is something I quickly put together that may be of use for you.
    Tony
    Attached Files Attached Files

  5. #5
    Join Date
    Nov 2008
    Posts
    24

    What I promised earlier

    Here is the cataloer and player etc etc. Its a work in progress so please be kind.
    Attached Files Attached Files

  6. #6
    Join Date
    Jan 2005
    Location
    Nanded, India
    Posts
    397
    Thanks Tonez90,

    I will come back to you after checking your valuable code and sample.

    BTW my email is: ashfaque_online@yahoo.com / sendemailon@yahoo.com

    Regards,
    Last edited by Ashfaque; 02-11-13 at 00:36.
    With kind regards,
    Ashfaque

  7. #7
    Join Date
    Jan 2005
    Location
    Nanded, India
    Posts
    397
    It produces following error in both ReloadTrack & sPlayFile on keyword "Me."

    "Invalid use of Me keyword"

    Is there any library ref to select?

    Regards,
    With kind regards,
    Ashfaque

  8. #8
    Join Date
    Nov 2008
    Posts
    24
    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.
    Attached Files Attached Files

  9. #9
    Join Date
    Jan 2005
    Location
    Nanded, India
    Posts
    397
    Again thanks Tony,

    I will check and come back to you to bother again.....
    With kind regards,
    Ashfaque

  10. #10
    Join Date
    Jan 2005
    Location
    Nanded, India
    Posts
    397
    It is working Tony.....Excellent work...

    My main problem is solved now. I hope it would not produce any error in future and support run time access too so that it could be run on any pc without MS Access I believe.

    Thanks a million Tony....
    With kind regards,
    Ashfaque

  11. #11
    Join Date
    Jan 2005
    Location
    Nanded, India
    Posts
    397
    Tony,

    I noticed that due to & ".mp3" control in CboSearchTrack, it works only limited files.I need to run all media files. I tried adding below code but doesnt support

    Dim StrFilter as String

    StrFilter = "All Media Files (*.*)" & Chr$(0) & "*.avi;*.asf;*.asx;*.wax;" & _
    "*.wvx;*.wpl;*.wm;*.wma;*.wmd;*.wav;*.wmv;*.wmx;*. mp3;*.mpg;" & _
    "*.mpeg;*.m1v;*.mp2;*.mpa;*.mpe;*.mpv2;*.m3u;*.mid ;*.midi;" & _
    "*.rmi;*.aif;*.aifc;*.divx;*.au;*.cda;*.ivf;*.mov; *.qt;" & _
    "*.bmp;*.jpg;*.wmf;*.emf;*.dib;*.gif;*.png;*.t if" & Chr$(0)


    slocation = DLookup("TrackLocation", "T_Track_Master", "Trackno = " & tnum)
    sfile = slocation & "\" & DLookup("TrackTitle", "T_Track_Master", "Trackno = " & tnum) & StrgFilter

    Any idea ?

    Thanks,
    With kind regards,
    Ashfaque

  12. #12
    Join Date
    Nov 2008
    Posts
    24

    Update for your considration

    Here is the cataloger I have been working on. I will look at the issues you said shortly.
    Tony
    Attached Files Attached Files

  13. #13
    Join Date
    Jan 2005
    Location
    Nanded, India
    Posts
    397
    Exellent work Tony....

    I will be waiting to sort out the issue.

    Thanks,
    With kind regards,
    Ashfaque

  14. #14
    Join Date
    Nov 2008
    Posts
    24
    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.
    Tony

  15. #15
    Join Date
    Jan 2005
    Location
    Nanded, India
    Posts
    397
    OK Tony,

    Although I am not perfect at VBA but I will follow your guidelines and let you know the outcome.

    Thanks,
    With kind regards,
    Ashfaque

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •