Results 1 to 5 of 5

Thread: Verifying more than one textbox has entries

  1. #1
    Acolyte tigerdel's Avatar
    Join Date
    Aug 2012
    Location
    Cambridgeshire
    Posts
    34
    Articles
    0
    Excel Version
    Office 365

    Verifying more than one textbox has entries



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi Guys

    I need to ensure that if a combobox has a specific entry, a further txtbox also needs an entry

    The code I have used for single entries is working fine but I can't get the dual entry to work

    The codes I use are as below:

    For the single entry [which does work], I used:

    Code:
    If cmbStatus.Value = "" Then
        MsgBox "You must add a Document Status", vbCritical
        Exit Sub

    For the dual entry [which won't work] I used:

    Code:
     If cmbStatus.Value = "Approved" & txtApprover.Value = "" Then
        MsgBox "You must enter the name of the Approver", vbCritical
        Exit Sub


    Any help gratefully received

    Many thanks for looking

    Derek









  2. #2
    Conjurer Logit's Avatar
    Join Date
    Nov 2016
    Posts
    208
    Articles
    0
    Excel Version
    2007
    .
    Shouldn't the Textbox be TEXT and not VALUE ?

    txtApprover.Text

  3. #3
    Magician NoS's Avatar
    Join Date
    Jan 2013
    Location
    British Columbia
    Posts
    722
    Articles
    0
    Excel Version
    Excel 2010 64bit
    try changing & to And

  4. #4
    Acolyte tigerdel's Avatar
    Join Date
    Aug 2012
    Location
    Cambridgeshire
    Posts
    34
    Articles
    0
    Excel Version
    Office 365

    Resolved

    Quote Originally Posted by Logit View Post
    .
    Shouldn't the Textbox be TEXT and not VALUE ?

    txtApprover.Text
    Turns out it was the & sign that should have read AND


    But thanks for looking

    Derek

  5. #5
    Acolyte tigerdel's Avatar
    Join Date
    Aug 2012
    Location
    Cambridgeshire
    Posts
    34
    Articles
    0
    Excel Version
    Office 365
    Quote Originally Posted by NoS View Post
    try changing & to And
    ​Spot on NoS - Thanks

Posting Permissions

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