Solved

ON CLICK CHANGE THE COLOR FILL OF TEXT BOX

Posted on 2007-11-28
3
762 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
Comment Utility
txtID.Enabled = True
 txtID.BackColor = vbYellow     '<<<<<<<<<<<<<<
_______________________

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

Accepted Solution

by:
TWBit earned 500 total points
Comment Utility
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
Comment Utility
I was making harder than what I made it out to be. Thanks TWBIT
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now