Solved

ON CLICK CHANGE THE COLOR FILL OF TEXT BOX

Posted on 2007-11-28
3
786 Views
Last Modified: 2013-11-28
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

0
Comment
Question by:goingolfn99
3 Comments
 
LVL 38

Expert Comment

by:puppydogbuddy
ID: 20367957
txtID.Enabled = True
 txtID.BackColor = vbYellow     '<<<<<<<<<<<<<<
_______________________

cmdAddNew.Enabled = False
txtID.BackColor = vbWhite     '<<<<<<<<<<<<<<
0
 
LVL 11

Accepted Solution

by:
TWBit earned 500 total points
ID: 20367973
Me.txtlocation.BackColor = vbYellow

When disabled, the background will be gray.  So maybe just set it to yellow in design?
0
 

Author Comment

by:goingolfn99
ID: 20368079
I was making harder than what I made it out to be. Thanks TWBIT
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question