Search results

  1. O

    Count iterations performed in SQL recordset loop

    Thanks for this appreciated. Do I insert this in between my existing While statement or do I need to create another separate one? Also how do I add this to a msg box?
  2. O

    Count iterations performed in SQL recordset loop

    Hi, I run the following code which loops through a recordset and performs a file copy based on a value in each record of the recordset. Given the value is a URL file link address its quite likely that the target file could get moved, deleted or changed which then creates an error, the code...
  3. O

    Can't Delete Folder after creating it through VBA

    OK, tried: Application.FollowHyperlink ("FoldernameDest") But still won't allow you to delete folder until RESET button in VBA pressed!
  4. O

    Can't Delete Folder after creating it through VBA

    Where in my code would I put that? not sure if you’ve watched the full thread but I’m not trying to delete in VBA. I’m running VBA code to allow a user to create a folder and copy some files to it. the problem occurs after that is complete as if the user then goes to delete the created...
  5. O

    Can't Delete Folder after creating it through VBA

    Sorry, I've not used application.followhyperlink before, tried this but get code error: Application.FollowHyperlink "C:\WINDOWS\explorer.exe """ & FoldernameDest & "", vbNormalFocus
  6. O

    Can't Delete Folder after creating it through VBA

    No, I have checked that. You just can't delete it until you press the VBA reset button, then it deletes as normal!
  7. O

    Can't Delete Folder after creating it through VBA

    Hi I tried your suggestion as below but still has no effect on allowing Directory to be deleted....? End If .Close End With Set fsObject = Nothing Shell "C:\WINDOWS\explorer.exe """ & FoldernameDest & "", vbNormalFocus MsgBox ("All datasheets copied to...
  8. O

    Can't Delete Folder after creating it through VBA

    What I can't understand is that the resulting code after the directory is checked is the same, yet the FALSE side of the IF statement you can delete the folder and yet the TRUE side you cannot unless you press the VBA RESET button......?
  9. O

    Can't Delete Folder after creating it through VBA

    'function to check if folder exist Function FolderExists(folderpath As String) As Boolean On Error Resume Next ChDir folderpath If Err Then FolderExists = False Else FolderExists = True End Function
  10. O

    Can't Delete Folder after creating it through VBA

    'routine to create your directory path Public Sub MakeDirectory(folderpath As String) Dim X, I As Integer, strPath As String X = Split(folderpath, "\") For I = 0 To UBound(X) - 1 strPath = strPath & X(I) & "\" If Not FolderExists(strPath) Then MkDir strPath Next I End Sub
  11. O

    Can't Delete Folder after creating it through VBA

    Thanks. I may not have made myself clear. I am not trying to delete the folder using VBA. The problem occurs when the user runs the code to create the folder and then subsequently uses file explorer to try and delete is as its no longer wanted they can't and get a windows error. I can simulate...
  12. O

    Can't Delete Folder after creating it through VBA

    ] Thanks so much, totally understand now! Appreciated
  13. O

    Can't Delete Folder after creating it through VBA

    [CODE]Private Sub cmdCreateDatasheetsFolder_Click() 'On Error GoTo ErrorHandler Dim strSQL As String Dim fsObject As Object Dim rs As DAO.Recordset Dim NewPath As String Dim Cancel As Integer Dim intStyle As String Dim strTitle As String Dim strMsg As String Dim Foldername As String Dim...
  14. O

    Can't Delete Folder after creating it through VBA

    I've tried that, you can delete the files but not the folder?
  15. O

    Can't Delete Folder after creating it through VBA

    Hi sorry to sound thick but am new to forum and have been told to post code in a specific way which I am still not clear on. Do I just put a: < followed by pasting code direct form VBA editor then followed by a: > ?
  16. O

    VBA SQL Query Runtime Error 3075

    Hi sorry to sound thick but am new to forum and have been told to post code in a specific way which I am still not clear on. Do I just put a: < followed by pasting code direct form VBA editor then followed by a: > ?
  17. O

    Can't Delete Folder after creating it through VBA

    I have an IF statement that checks to see if a folder exists. If False it creates a folder and copies a specific file into it. After the above process you can delete the folder through explorer as any normal file operation. If the above IF statement is True (Folder already exists) then the...
  18. O

    VBA SQL Query Runtime Error 3075

    Oh yer, ok, what about if you are posting a bigger chunk?
  19. O

    VBA SQL Query Runtime Error 3075

    Also some people put the code in a neat box how do you do that?
  20. O

    VBA SQL Query Runtime Error 3075

    Sorry, new to this forum stuff! How do you do the code tags?
Back
Top Bottom