dan1dyoung
Registered User.
- Local time
- Today, 13:48
- Joined
- Apr 9, 2005
- Messages
- 76
I have tried running the code in two halfs and they both work OK, but together i get the path not found error.
Total Code
One part, works OK
other part, works OK
So no problems with field values in the string?????
Thanks
Dan
Total Code
Code:
Dim strDeleteQuoteRecordMsg As String
strDeleteQuoteRecordMsg = "Are you sure you want to delete this Quote?"
Beep
If MsgBox(strDeleteQuoteRecordMsg, vbYesNo, APP_TITLE) = vbYes Then
DoCmd.SetWarnings False
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.SetWarnings True
Forms!frmQuotesList.lstQuotes.Requery
Dim strDeleteQuoteFolderMsg As String
strDeleteQuoteFolderMsg = "Do you also want to delete the Folder and Files on the server?"
If MsgBox(strDeleteQuoteFolderMsg, vbYesNo, APP_TITLE) = vbYes Then
DeleteDir = "C:\accesstest\" & [Forms]![frmViewQuote]![TotalQuoteNumber]
If Dir(DeleteDir, vbDirectory) <> "" Then
Dim MyObject As Object
Set MyObject = CreateObject("Scripting.FileSystemObject")
MyObject.DeleteFolder DeleteDir, True
Dim strDeleteQuoteFolderSuccessMsg As String
strDeleteQuoteFolderSuccessMsg = "The Folder and Files were deleted!"
MsgBox "strDeleteQuoteFolderSuccessMsg,,APP_TITLE"
DoCmd.Close
Else
Dim strDeleteQuoteFolderEmptyMsg As String
strDeleteQuoteFolderEmptyMsg = "No Folders or Files to delete!"
MsgBox "strDeleteQuoteFolderEmptyMsg,,APP_TITLE"
DoCmd.Close
End If
Else
' Do nothing
End If
One part, works OK
Code:
DeleteDir = "C:\accesstest\" & [Forms]![frmViewQuote]![TotalQuoteNumber]
If Dir(DeleteDir, vbDirectory) <> "" Then
other part, works OK
Code:
DeleteDir = "C:\accesstest\" & [Forms]![frmViewQuote]![TotalQuoteNumber]
If Dir(DeleteDir, vbDirectory) <> "" Then
Dim MyObject As Object
Set MyObject = CreateObject("Scripting.FileSystemObject")
MyObject.DeleteFolder DeleteDir, True
So no problems with field values in the string?????
Thanks
Dan