Results 1 to 3 of 3

User Form look at 2 Txt Boxes for entry but needs only one completed or a MSG will display

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-03-2014
    Location
    South-Africa
    MS-Off Ver
    2010
    Posts
    133

    User Form look at 2 Txt Boxes for entry but needs only one completed or a MSG will display

    Hi There...

    I have the following code (See below) that warns the User to input the required data into the relevant fields. If he tries to submit the data with an empty field then a message is displayed. My problem here is that the statement need to look at both the fields but, requires that only the one must be completed. However the field completed can be either "Textbox_ReclaimedSand15sec" or "Textbox_ReclaimedSand30sec".

    If Trim(Me.Textbox_ReclaimedSand15sec.Value) = "" Then
    Me.Textbox_ReclaimedSand15sec.SetFocus
    MsgBox "Please enter Reclaimed Sand Weight", vbExclamation, "Movements"
    Exit Sub
    End If
    
    If Trim(Me.Textbox_ReclaimedSand30sec.Value) = "" Then
    Me.Textbox_ReclaimedSand30sec.SetFocus
    MsgBox "Please enter Reclaimed Sand Weight", vbExclamation, "Movements"
    Exit Sub
    End If
    Does anyone know what code I need to add to above?
    Last edited by Colin Smit; 12-05-2014 at 01:13 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Filter Using User Form & Display the Whole Row of the Search Result on the Text boxes
    By Revolversus2 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-18-2014, 02:28 AM
  2. [SOLVED] Userform multipage control exit events code execution not completed before next user entry
    By jane serky in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-10-2013, 04:39 AM
  3. Replies: 5
    Last Post: 05-09-2012, 08:10 AM
  4. Show look up results in user form and display warning if overwritting existing entry
    By yapjooleong in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-26-2010, 01:50 PM

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