Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Folder Button

Geek News

Folder Button
"dan.cawthorne[ at ]gmail.com" <dan.cawthorne[ at ]gmail.com> 11/25/2008 3:36:10 PM
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?
RE: Folder Button
RonaldoOneNil 11/25/2008 4:25:02 PM
myPath = DLookup("[masterfolderlocation]","tblFolderLocation") &
Me.[ProjectQNo] & " - " & Me.[ProjectTitle]

"dan.cawthorne[ at ]gmail.com" wrote:

[Quoted Text]
> 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?
>
Re: Folder Button
"dan.cawthorne[ at ]gmail.com" <dan.cawthorne[ at ]gmail.com> 11/25/2008 5:34:15 PM
On 25 Nov, 16:25, RonaldoOneNil
<RonaldoOne...[ at ]discussions.microsoft.com> wrote:
[Quoted Text]
> myPath = DLookup("[masterfolderlocation]","tblFolderLocation") &
> Me.[ProjectQNo] & " - " & Me.[ProjectTitle]
>
> "dan.cawtho...[ at ]gmail.com" wrote:
> > 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?

Thanks Works a like a charm.

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net