Create dir based on record ID

P

Pamela

I've been able to come up with this code to create a directory and open it
but I need the directory to be based on the Record ID, which obviously
changes, any suggestions on how to do this?? Here is the code I have so
far... the current dir is a manual one I've been playing with, 0001, 0002,
0003, etc. If it needs to change to be 1,2,3, etc., that's fine too..
Thanks, in advance!!


Private Sub Command2_Click()
On Error GoTo Err_Command2_Click
strPath = "C:\Documents and Settings\Pamela\Desktop\CAP
Business\Album\0003"
If Dir(strPath, vbDirectory) = "" Then
MkDir (strPath)
End If
Application.FollowHyperlink strPath
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click
End Sub
 
D

Douglas J. Steele

strPath = "C:\Documents and Settings\Pamela\Desktop\CAP Business\Album\"
& Format(Me!RecordID, "0000")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top