blacy
Technical User
- Jun 17, 2000
- 16
After 2003 - 2007 office upgrade I have and event proceedure that creates a new directory on a drive. WHen running the code I get an error 2950. I have alread trusted the drive and subdirectories. I am not sure if this is a problem because I am acting outside of office environment with the action of creating a new directory or if there is another problem. Any help would be great..
Private Sub Combo80_AfterUpdate()
On Error GoTo Err_Combo80_AfterUpdate
Dim strServerPath As String
Dim strNewDirectoryName As String
Dim strNewFullPathName As String
Dim strQuoteFormsPathName As String
Dim strQuoteFormsFileName As String
strNewDirectoryName = Me![QuoteRef]
strServerPath = DLookup("QuoteFilePath", "ZZCompanyInfoTable1", "CompanyID= " & 1)
strNewFullPathName = strServerPath & strNewDirectoryName
strQuoteFormsPathName = DLookup("QuoteFormsPath", "ZZCompanyInfoTable1", "CompanyID= " & 1)
strQuoteFormsFileName = "PanelmaticQuote1.xls"
DoCmd.RunMacro "Quote Form Macros.Set Company"
MkDir strNewFullPathName
Me.QuoteFilePath = strNewFullPathName
Dim fs As Object
Set fs = CreateObject("scripting.filesystemobject")
If fs.FileExists(strQuoteFormsPathName & strQuoteFormsFileName) Then
fs.CopyFile strQuoteFormsPathName & strQuoteFormsFileName, strNewFullPathName & "\" & strNewDirectoryName & ".xls", True
End If
Set fs = Nothing
Me.Refresh
Exit_Combo80_AfterUpdate:
Exit Sub
Err_Combo80_AfterUpdate:
MsgBox "Directory already exist"
End Sub