Solved

ON CLICK CHANGE THE COLOR FILL OF TEXT BOX

Posted on 2007-11-28
3
777 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

863 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

19 Experts available now in Live!

Get 1:1 Help Now