Results 1 to 4 of 4
  1. #1
    ymds is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2010
    Posts
    19

    relative path to sounds... strange

    huge problem! relative links act strange..

    i tried to write this:


    Option Compare Database

    Private Sub Command27_Click()

    End Sub

    Private Sub Form_Open(Cancel As Integer)


    API_PlaySound "C:\Documents and Settings\8lab105\Desktop\myFile\music\mySound.wav"
    End Sub


    how can i turn that absolute link into relative? nothing works... i tried to write: "\mySound.wav" but nothing......

    (the workbook and the wav files are in the same folder)...

  2. #2
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,035
    Hi,

    if the access project sits in the same folder as the wave sounds, you can get the folder using the path property of the currentproject object

    strPath = currentProject.path

  3. #3
    ymds is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2010
    Posts
    19

    can u please use the example

    i wrote in the previous message?
    i'm new to vba and programming, so i'll be very grateful if u write that line in the code i gave..

    tnx!!!

  4. #4
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    Option Compare Database

    Private Sub Form_Open(Cancel As Integer)

    dim strPath As String
    dim wavPath As String

    strPath = currentProject.path
    wavPath = strPath & "\mySound.wav"

    API_PlaySound wavPath
    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. A Little bit strange...
    By Maverick1501 in forum Access
    Replies: 0
    Last Post: 03-29-2010, 09:59 AM
  2. Replies: 6
    Last Post: 03-17-2010, 10:09 PM
  3. databasing CDs, sounds easy right?
    By RAGEFEAR in forum Access
    Replies: 8
    Last Post: 06-02-2009, 04:15 PM
  4. relink to relative path TXT data files
    By tobynegus in forum Programming
    Replies: 0
    Last Post: 08-19-2008, 10:10 AM
  5. Access 2007 Attachments - Relative reference
    By soringc in forum Programming
    Replies: 0
    Last Post: 11-22-2007, 10:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums