View Single Post
 
Old 05-08-2015, 02:50 AM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

I think I too might follow the approach suggested by NoSparks, but the following should work

Code:
Private Sub txtBillToCust_Exit(ByVal Cancel As MSForms.ReturnBoolean)
'Checks the txtBillToCust field for a blank entry
    If Not Len(txtBillToCust.Text) = 8 Then
        txtBillToCust.BackColor = &HFF&
        MsgBox "Please enter the 8-digit Customer Number"
        Cancel = True
        txtBillToCust.Text = ""
        txtBillToCust.SetFocus
        Exit Sub
    Else
        txtBillToCust.BackColor = &H80000005
    End If
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote