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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access frm Text Field Goes Black

Status
Not open for further replies.

Bill6868

Technical User
Mar 20, 2007
96
US
After converting my Access databases from Office 2000 to Office 2007 some of the form text fields fore color and back color will both change to black when exiting the field making the field unreadable. This did not happen with all my databases but some of them.

I’ve tried creating a blank 2007 database and importing all my objects form the old version but this didn’t help.

Is this just a 2007 quirk? Anyone have a solution? Is anyone experiencing the same problem?

Good grief!
 
You should be able to write some VBA code to set the relevant properites if they are both black (equal to each other? - or are they not 0 black?)

Unless it would just be easier to fix manually?

I've hardly touched 2007, so I can't tell you anything specific there.

Although, I suspect that there may be a wider pallet supported in the newer version and therefore the colors you chose are both mapped to black for some odd reason. That's just a wild guess.
 
If I write the following code in both the After Update and On Lost Focus events it will take care of it, but I'm wondering why this happens in 2007. I have never experienced this in in other version of Access. The problem seems to occur in combo boxes and not in regular text boxes.

The following is a combo box populated from a look-up table.

Private Sub Author_AfterUpdate()

[Author].ForeColor = vbBlack
[Author].BackColor = vbWhite

End Sub

Private Sub Author_LostFocus()

[Author].ForeColor = vbBlack
[Author].BackColor = vbWhite

End Sub
 
I suspect that there may be a wider pallet supported in the newer version and therefore the colors you chose are both mapped to black for some odd reason. That's just a wild guess.
That is correct. There are colors in 2007 not supported in earlier version, but I have never seen the problem the other way. I would reset the fore and back color values in the new db for the fields that cahange. Is there any code on these fields? However, first make sure your 2007 db has all of the new office updates installed.
 
Thanks everyone.

Writing the code in the After Update and On Lost Focusd events worked, as did resetting the values in the format properties.

Thanks for the link to the article.
 
I had intended code that would be run once to loop through each control on each form and fix it... the controltype property would be the key to getting this to work...

Clearly changing the properties manually is better than adding code to the after update event.
 
Bill6868 . . .
Bill6868 said:
[blue]After converting my Access databases from Office 2000 to Office 2007 some of the form text fields fore color and back color will both change to black [purple]when exiting the field[/purple] ...[/blue]
Definitely sounds like a bug!

By chance do you have any code in the [blue]On Exit[/blue] or [blue]Lost Focus[/blue] event of these controls? Take note of the BackGround/ForeGround colors that do work ... when you change them. In either case you've shown [blue]a patch is required to fix the problem[/blue].

You've also supported the reason why I don't allow my clients to upgrade [blue]until successor version problems[/blue] are resolved. I have a stipulation in my service contracts that saids: [blue]if the client upgrades without my permission ...[/blue] [purple]there on there own![/purple]. To date ... all my clients are stuck with 2003. They all want to move to at least 2007, but I wont allow it until certain problems are resolved. [thumbsup2]

[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
This problem exists going the other direction (from 2007 to earlier versions) and is a known issues. In this case it is not a bug, but a backward compatibility of an unsupported feature.
In Access 2007, forms have color themes which can be changed globally across all the Office products. Setting your colors properly let your forms take advantage of these global changes. For instance, you should use colors like:

"Background Form" for the detail section
"Background Light Header" for headers and footers
"Dark Text" for labels
"System Button Text" for command buttons
CAUTION: These colors are not backward compatible, so if you use these in Access 2007 and your users are using an older version of Access, these colors will appear Black, so you'll need to programmatically modify these if you're not in Access 2007

This could be somehow related in the conversion from 2000 to 2007, although I have never seen it.

Bill if you provide the original color property and the resultant property in A2007 and any code that changes the color, we can provide a global procedure to fix it permanently.

What lameid is suggesting is a permanent solution like this:
loop the all forms in current project
Open the forms in design view (hidden)
loop the control collection for each form
look for the offending color/s
change that property to the correct property
next control
save the form
next form
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top