Folder Button

D

dan.cawthorne

Hi,

I was wondering if some one could help me tweak the following code i
have?

the following codes allows me to create a folder on our server based
on two fields with that record, and its stored at"P:\ QUOTATIONS\"

Instead of the the "P:\QUOTATIONS\" been hard coded into the VB I've
created a table for the location to be stored

Table is called "tblFolderLocation" and field is called
"masterfolderlocation"

So below is the existing code I'm Using

Private Sub Command236_Click()
On Error GoTo PROC_ERR

Dim myPath As String
myPath = "P:\QUOTATIONS\" & Me.[ProjectQNo] & " - " & Me.
[ProjectTitle]
MkDir myPath
MkDir myPath & "\Estimate"
MkDir myPath & "\Submission"
MkDir myPath & "\Tender Info"
MkDir myPath & "\Quotes"
MkDir myPath & "\Enquirys"

DoCmd.OpenForm "frm_MakefolderSuccesful"


PROC_EXIT:
Exit Sub
PROC_ERR:
If err.Number = 2101 Then
Msgbox "Folder Has Been Already Been Created"
Else
Msgbox "Folder Has Been Already Been Created"
End If

End Sub

This is the attempt i made, as Below

Private Sub Command236_Click()
On Error GoTo PROC_ERR

Dim myPath As String
myPath = "FolderLocation!Masterfolderlocation" & Me.[ProjectQNo] & " -
" & Me.[ProjectTitle]
MkDir myPath
MkDir myPath & "\Estimate"
MkDir myPath & "\Submission"
MkDir myPath & "\Tender Info"
MkDir myPath & "\Quotes"
MkDir myPath & "\Enquirys"

DoCmd.OpenForm "frm_MakefolderSuccesful"


PROC_EXIT:
Exit Sub
PROC_ERR:
If err.Number = 2101 Then
Msgbox "Folder Has Been Already Been Created"
Else
Msgbox "Folder Has Been Already Been Created"
End If

End Sub

When i run the button this event is behind it creates a folder is the
H: but names the folder as FolderLocation!Masterfolderlocation + the
ProjectQNo & ProjectName

can you assist?
 
R

RonaldoOneNil

myPath = DLookup("[masterfolderlocation]","tblFolderLocation") &
Me.[ProjectQNo] & " - " & Me.[ProjectTitle]
 
D

dan.cawthorne

myPath = DLookup("[masterfolderlocation]","tblFolderLocation") &
Me.[ProjectQNo] & " - " & Me.[ProjectTitle]

I was wondering if some one could help me tweak the following code i
have?
the following codes allows me to create a folder on our server based
on two fields with that record, and its stored at"P:\ QUOTATIONS\"
Instead of the the "P:\QUOTATIONS\" been hard coded into the VB I've
created a table for the location to be stored
Table is called "tblFolderLocation" and field is called
"masterfolderlocation"
So below is the existing code I'm Using
Private Sub Command236_Click()
On Error GoTo PROC_ERR
Dim myPath As String
myPath = "P:\QUOTATIONS\" & Me.[ProjectQNo] & " - " & Me.
[ProjectTitle]
MkDir myPath
MkDir myPath & "\Estimate"
MkDir myPath & "\Submission"
MkDir myPath & "\Tender Info"
MkDir myPath & "\Quotes"
MkDir myPath & "\Enquirys"
DoCmd.OpenForm "frm_MakefolderSuccesful"
PROC_EXIT:
Exit Sub
PROC_ERR:
If err.Number = 2101 Then
Msgbox "Folder Has Been Already Been Created"
Else
Msgbox "Folder Has Been Already Been Created"
End If
This is the attempt i made, as Below
Private Sub Command236_Click()
On Error GoTo PROC_ERR
Dim myPath As String
myPath = "FolderLocation!Masterfolderlocation" & Me.[ProjectQNo] & " -
" & Me.[ProjectTitle]
MkDir myPath
MkDir myPath & "\Estimate"
MkDir myPath & "\Submission"
MkDir myPath & "\Tender Info"
MkDir myPath & "\Quotes"
MkDir myPath & "\Enquirys"
DoCmd.OpenForm "frm_MakefolderSuccesful"
PROC_EXIT:
Exit Sub
PROC_ERR:
If err.Number = 2101 Then
Msgbox "Folder Has Been Already Been Created"
Else
Msgbox "Folder Has Been Already Been Created"
End If
When i run the button this event is behind it creates a folder is the
H: but names the folder as FolderLocation!Masterfolderlocation + the
ProjectQNo & ProjectName
can you assist?

Thanks Works a like a charm.
 

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