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