Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Box font color 1

Status
Not open for further replies.

tman72

Technical User
Jan 22, 2003
116
US
I have inherited an app that has different colored text boxes. I discovered this when one of the users of the app changed their desktop theme and some text in the text boxes remain black (which is what I want) while others are not. I checked in design view and some text boxes are set to different fore colors in the properties. Can this be done in code and if so how?.....or do I need to resort to picking them and changing them manually? Any help is appreciated.
 
How are ya tman72 . . .

Are you saying you want to parse thru all forms and change any non-black texboxes to black?

Calvin.gif
See Ya! . . . . . .
 
Try this (loops thru all forms/textboxes):
Code:
[blue]   Dim cpFrm As AccessObject, frm As Form, ctl As Control
   
   For Each cpFrm In CurrentProject.AllForms
      DoCmd.OpenForm cpFrm.Name, acDesign, , , , acHidden
      DoEvents
      Set frm = Forms(cpFrm.Name)
      
      For Each ctl In frm.Controls
         If ctl.ControlType = acTextBox Then
            ctl.ForeColor = 0
         End If
      Next
      
      DoCmd.Close acForm, cpFrm.Name, acSaveYes
      Set frm = Nothing
   Next[/blue]

Calvin.gif
See Ya! . . . . . .
 
Thanks Aceman. Exactly what I needed and what a time saver!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top