+ Reply to Thread
Results 1 to 2 of 2

How to detect if user select cancel InputBox VBA MS Access

  1. #1
    Forum Contributor
    Join Date
    09-21-2015
    Location
    nederland
    MS-Off Ver
    2021
    Posts
    202

    How to detect if user select cancel InputBox VBA MS Access

    I have an input box asking user to Click OK to continue! export data from MS Access. How do I let the program know to Exit without export data from MS Access to excel if the user click cancel.

    With below VBA when I Click cancel the program still export data from Ms Access to Excel

    I would lik if I click cancel exit sub


    Please Login or Register  to view this content.
    Last edited by kirana2014; 05-11-2021 at 02:51 PM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,532

    Re: How to detect if user select cancel InputBox VBA MS Access

    If the user hits Cancel, InputBox returns the null string. Same thing happens if the user hits OK but leaves the input box blank.

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] delete specific cell value if user clicks on cancel in inputbox
    By MaartenRo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-25-2020, 12:54 AM
  2. [SOLVED] MACRO: If user clicks cancel in inputbox,then do nothing. Problem with inputbox appearance
    By Tona in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-05-2015, 04:33 AM
  3. detect windows user name and allow access to excel file
    By bqheng in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-20-2015, 04:05 AM
  4. [SOLVED] InputBox User Clicked Cancel
    By goss in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-05-2014, 03:19 PM
  5. [SOLVED] Repeat Inputbox if user click cancel or if user enter character not in selection criteria
    By Faridwahidi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-24-2014, 02:44 AM
  6. [SOLVED] Looping sub not detecting user cancel from inputbox
    By jshaw82 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2013, 06:14 PM
  7. Detect if user hits cancel from user input type box
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-20-2011, 11:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1