+ Reply to Thread
Results 1 to 2 of 2

Prevent entering through a msgbox accidentally

  1. #1
    Registered User
    Join Date
    08-12-2009
    Location
    Cardiff, Wales
    MS-Off Ver
    Excel 2007
    Posts
    53

    Prevent entering through a msgbox accidentally

    Hello, I have a workbook that gets data entered by scanning a barcode. And now and again, depending on what is being entered and what is already entered, the code throws up a msgbox, eg below
    Please Login or Register  to view this content.
    This all works fine, and I have a different outcome for yes and no. The problem I have is because of the barcode scanner. When data is being scanned, the barcode scaner automatically puts and ENTER after each scan (which is required). But if a user is blindly scanning and gets an error, ie a msgbox, if they dont notice and scan the next item, then the scanner ENTERS through the msgbox by selecting YES.

    I need to somehow prevent the user from entering through the msgbox? Either by only allowing the mouse to click yes or no, so the scanners ENTER wont do any thing. Or maybe having an INPUT line in the msgbox also, that requires a password before the yes/no buttons are active?
    Is this possible?
    Any other suggestions most welcome and appreciated.
    Thanks
    Andrew

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Prevent entering through a msgbox accidentally

    Look at the help file for MsgBox, specifically the vbDefaultButton1, and vbSystemModal. With these you might be able to trap the extra Enter.
    David
    (*) Reputation points appreciated.

+ 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. Msgbox to prevent users entering names from a list in to another range.
    By wanty in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 07-11-2013, 07:52 PM
  2. Prevent from entering negative amounts
    By oteixeira in forum Excel General
    Replies: 1
    Last Post: 12-23-2008, 05:47 PM
  3. Prevent users from entering alphabet!
    By se7en_hills in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 10-24-2008, 02:27 PM
  4. Entering variables on Msgbox prompt
    By renegan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-04-2006, 02:54 PM
  5. Prevent closing MsgBox from X
    By helmekki in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-16-2005, 03:17 PM

Tags for this Thread

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