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

Back Style Property on Form controls get reset to Transparant 1

Status
Not open for further replies.

08211987

Programmer
Apr 20, 2012
187
0
0
US
Hi,
Has anyone experienced a Form's textbox fields Back Style property changing transparent after focus has changed to another textbox control? I have many comboboxes that are populated from tables and code to .Requery and I am wondering if that has anything to do with it. When a new form is opened all fields display white but after I click on the first dropdown and select a value the after update event has code to do a .Requery on the next field whose dropdown values change based on the first field. The focus is then given to the next field because it is the next field that should be completed. Once the second field gains focus the first field becomes transparent. It is still editable and if you click in it, it will turn white again.

This is example of the 2nd field's after update event, once this is done and the Subdivision_Name gets focus the Division_Name, Merchandising_Dir, and Merchandiser become transparent. As each field is updated and the user tabs to other fields the field becomes transparent although editable.

Private Sub Division_Name_AfterUpdate()
DoCmd.SetWarnings False
Me.Division_Name.Requery
DoCmd.OpenQuery "qry_Get_DIV_Nbr", acViewNormal, acEdit
Set db3 = CurrentDb()
Set rst3 = db3.OpenRecordset("tbl_DIV_Nbr", dbOpenDynaset)
Me!Division.Value = rst3![MDV_NBR]
Me.Subdivision_Name.Value = ""
Me.Subdivision_Name.Requery
Me.Subdivision_Name.SetFocus
Me.Merchandising_Dir.Requery 'field on form becomes transparant
Me.Merchandising_Mgr.Requery
Me.Merchandiser.Requery 'field on form becomes transparant

DoCmd.SetWarnings True
End Sub

It's very strange. Any ideas would be welcomed!
Thanks.
 
I'm not sure why, but the form controls were taking on the color of the background color of the form which was a light gray even though their Back Styles were set to Normal. By changing the background of the form to white they maintained the white color after losing the focus. So no need to reply.
Thanks!
 
That was a recognized bug in v2007; from Allen Browne's article on 2007 bugs:

Allen Browne said:
"A combo may display as transparent when focus leaves it. Workaround: set
the AlternateBackColor property of the the (Detail?) Section to something
other than "No Color", e.g. #80000027."

Then definitive answer is to install the Hotfix that you can download here:



The Missinglinq

Richmond, Virginia

The Devil's in the Details!
 
Thanks! Haven't tried it yet since I am good for now but appreciate the info!
Have a great day!
 
To be honest, I'm always leery about installing a hotfix for a single problem, if I've found a workaround for the problem; Microsoft's 'fixes' often end up 'breaking' something else!

The Missinglinq

Richmond, Virginia

The Devil's in the Details!
 
We ran into this same issue three or four years ago when we tried to convert to Access 2007 (but keeping 2003 formatted DB). I think it only happened on ComboBox & Text box after you tabbed through (or lost focus).
It seemed random, but we found a solution that was applied to the forms where it did happen:

In the FOrm_Load section, we added the following line:

Me.Section(0).Properties("AlternateBackColor") = 16777215
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top