Search results

  1. D

    Cancel code based on cancel in browser window

    Thank you (again!) I think this works now Private Sub ExportExcel_Click() Dim strPath As String strPath = GetFolderName() If strPath = "" Then Exit Sub Else DoCmd.OutputTo acOutputReport, "SOP30DayRPT", acFormatXLS, "SOP30DayRPT - " & Format(Date, "mmddyyyy") & ".xls" End If
  2. D

    Cancel code based on cancel in browser window

    I am not sure how to get the information returned from the GetFolderName. If I understand what you are saying I would thinks something like this but I can't figure out the If statement. Am I getting closer? Private Sub ExportExcel_Click() If GetFolderName() = Null Then Exit Sub Else...
  3. D

    Cancel code based on cancel in browser window

    I don't know what to do --- that is as always my problem. I just know that the code works to save it to the correct folder but will not cancel when cancel is clicked. I do not understand at all how it is working because there is nothing showing in the Excel sub that displays the folder name.
  4. D

    Cancel code based on cancel in browser window

    Here is what I am getting if I select a folder.
  5. D

    Cancel code based on cancel in browser window

    If you are referring to your statement "I would test to see if anything is returned by GetFolderName. No need for msgbox, that was just there to show the logic." I know that the GetFolderName "GetFolderName = strFolderName" shows the folder I selected. And if I don't do anyting about the...
  6. D

    Cancel code based on cancel in browser window

    Yeah - I know I am picking at this because I don't know what to do. What are you referring to as "Try what I suggested" I think I have been doing that but I am sure i missed something
  7. D

    Cancel code based on cancel in browser window

    If the user selects a folder the GetFolderName does show that folder I am just not getting referencing the GetFolderName correctly in the ExportExcel code
  8. D

    Cancel code based on cancel in browser window

    I tried changing the strCancel=0 and thought it was working but now I can't get the code to run, it only exits sub,
  9. D

    Cancel code based on cancel in browser window

    Tried adding the strCancel and referencing it in my ExcelReport code - both locations it shows True but still skips over the exit sub and runs the code... Not sure what I need to do. Public Function GetFolderName(Optional OpenAt As String) As String Dim lCount As Long Dim strFolderName...
  10. D

    Cancel code based on cancel in browser window

    Thank you for providing the code - that is really helpful but one more question and I am sure this is something I should be able to see but how do I end the code at the MsgBox. My DoCmd.OutputTo acOutputReport, "SOP30DayRPT", acFormatXLS, "SOP30DayRPT - " & Format(Date, "mmddyyyy") & ".xls"...
  11. D

    Cancel code based on cancel in browser window

    Thanks - getting closer now.
  12. D

    Cancel code based on cancel in browser window

    Tried that code and it does not work, it does not end the code if the cancel is pushed.
  13. D

    Cancel code based on cancel in browser window

    That is a screenshot of what is displayed when I select Show - and it stays that way no matter what I do, cancel or select the downloads folder
  14. D

    Cancel code based on cancel in browser window

    I have to admit I don't know why this works but by putting the GetFolderName in the output code this seems to work. I did not write the code for these but adapted what I found on line. So if I understand your reply I can put an if statement in the GetFolderName function and if Null or ZLS...
  15. D

    Cancel code based on cancel in browser window

    I am using the following function found on the web to open a browser window to allow the user to select the location for a download of an excel file. All is working correctly EXCEPT if the user clicks the cancel button on the browser window the code that follows runs anyway. How can I cancel...
  16. D

    Solved Command button on Report to export to excel

    I got the code working perfectly - browser window allows the choice of folder and the export to excel works; Appreciate your replies.
  17. D

    Solved Command button on Report to export to excel

    I think I found the answer here: https://stackoverflow.com/questions/19372319/vba-folder-picker-set-where-to-start (I can't copy and paste code - it get all messed up - sorry - but it is the code about half way down and starts with Public Function GetFolderName( Optional<OpenAt...
  18. D

    Solved Command button on Report to export to excel

    This is really great but all I need is to select the path to the folder but not select a file within. I am not sure what of the code to remove to just get the path to the folder selected. Could you please give me some help on this. I then need to make it work with my export code. Maybe I can...
  19. D

    Solved Command button on Report to export to excel

    I am getting closer to what I want by using the following. The problem with this is it puts the results I'm the folder where the access application is. If I could get this to put the file in the user's documents file I could make that work. Public Function MyDocumentFile(ByVal filName As...
Back
Top Bottom