my objective is to change the textbox backcolor to green, if empty.


'please execute & find the answer:-
'it has 1 command button cmdadd tabindex 3)
' 3 text boxes - txtcandid(ti 0),
' txtappliedfor(ti 1),
' txtindustryid(ti 2)
'another command button cmdindustryhelp(tabstop false) next to industryid.
'
' form looks like this:-
'--------------------------------------------
'| |
'| txtCandid
'| txtappliedfor
'| txtindustryid cmdindustryhelp
'|
'| cmdadd
'--------------------------------------------

Private Sub cmdAdd_Click()
txtAppliedfor.SetFocus
End Sub

Private Sub cmdIndustryIdHelp_Click()
MsgBox "hello"
txtIndustryId.SetFocus
End Sub

Private Sub Form_Load()
txtCandId.Enabled = False
End Sub

Private Sub txtAppliedfor_GotFocus()
txtAppliedfor.BackColor = vbWhite
End Sub

Private Sub txtAppliedfor_Validate(Cancel As Boolean)
If txtAppliedfor.Text = "" Then
txtAppliedfor.BackColor = vbGreen
End If
End Sub


can u help?

friendly,
jey.