Link to home
Start Free TrialLog in
Avatar of goingolfn99
goingolfn99Flag for United States of America

asked on

ON CLICK CHANGE THE COLOR FILL OF TEXT BOX

Probably an easy 500 points.  When i click my button (cmdAddNew) I would like the color fill of one textbox (txtLocation) to be yellow so the user will know to make sure to fill the area. and then have it back to normal gray color once it is saved since the  textbox will go back to its normal setting of enabled = false.
Private Sub cmdAddNew_Click()
    
    txtName = Null
    txtPosition = Null
    txtLocation = Null
    txtID = 0
    chkNew = True
    '--- enable the text boxes and the Save button
    
    txtID.Enabled = True
    txtName.Enabled = True
    txtPosition.Enabled = True
    txtLocation.Enabled = True
    
    
    
    txtName.SetFocus
    '--- disable the list box, the Add New button, the Close button, and the Edit button
    '--- must be done after the setfocus as we cannot disable something that has focus
    lstEmployee.Enabled = False
    cmdAddNew.Enabled = False
    cmdEdit.Enabled = False
    cmdExit.Enabled = True
    cmdClear.Enabled = True
    cmdSave.Enabled = True
    cmddelete.Enabled = False
 
End Sub

Open in new window

Avatar of puppydogbuddy
puppydogbuddy

txtID.Enabled = True
 txtID.BackColor = vbYellow     '<<<<<<<<<<<<<<
_______________________

cmdAddNew.Enabled = False
txtID.BackColor = vbWhite     '<<<<<<<<<<<<<<
ASKER CERTIFIED SOLUTION
Avatar of TWBit
TWBit
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of goingolfn99

ASKER

I was making harder than what I made it out to be. Thanks TWBIT