Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Forms

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 07-04-2009, 11:36 AM
michaelpclisbee michaelpclisbee is offline Windows Vista Access 2007 (version 12.0)
Novice
 
Join Date: Jul 2009
Posts: 2
michaelpclisbee is on a distinguished road
Question trying to add color to texboxes

On my forms, I want to have the background color on a textbox change when it is selected, then go back to default when you tab to the next textbox. Is there some generic code that will do this? I have up to 20 txtboxes per tab, and dont want to have to add code specifically for each box...
thanks
Reply With Quote
  #2  
Old 07-04-2009, 12:07 PM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,264
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

You would need to put code or a macro in the GotFocus/LostFocus or OnEnter/OnExit events of each control. Hmm...I wonder if creating the control you want and then using it to set your default control would add the code as well. I'll have to give that a try.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
  #3  
Old 07-04-2009, 12:45 PM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,264
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

OK, a macro does not stay with the default control but it is *real* easy to set the two events of many controls to the same macros. And it is easy to create two macros that work in all of the controls.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Color/font change in subform AndyKim Forms 9 06-24-2009 02:34 PM
Export Report as jpeg (in color) Kupot Reports 1 05-28-2009 06:13 PM
background color in a form taggart Forms 1 05-07-2009 08:37 AM
Row and colum color editing jerald Database Design 0 03-18-2009 03:52 PM
change cell color bishop743 Programming 0 02-01-2009 08:00 AM


All times are GMT -8. The time now is 02:58 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.