Solved

ON CLICK CHANGE THE COLOR FILL OF TEXT BOX

Posted on 2007-11-28
3
805 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

726 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