Fields BackStyle/BackColor Changes Unexpectantly

J

JamesJ

Access 2007

I'm using the following code to filter records in frmHomeInv.

Dim strAll As String
Dim strSQL As String

If Me!cboProductTypeFilter.Column(1) = "<<All>>" Then

strAll = "SELECT * FROM tblHomeInv ORDER BY ProductTypeID, Product"
Me.RecordSource = strAll
Me.lstHomeInv.RowSource = strAll
Me.lstHomeInv.Selected(0) = True

Else

strSQL = "SELECT * FROM tblHomeInv WHERE (((ProductTypeID)=" &
[cboProductTypeFilter].[Value] & "))ORDER BY ProductTypeID, Product"
Me.RecordSource = strSQL
Me.lstHomeInv.RowSource = strSQL
Me.lstHomeInv.Selected(0) = True

End If

After returning the proper records, the BackStyle or the BackColor of the
ProductTypeID field that is in tblProductType and has a relationship with a
field by the
same name in tblHomeInv, changes to the existing BackColor of the Detail
section of the Form.
This does not occur at this time with any other form but has previously and
I'm not sure why it stopped doing it.
Even placing code at the end of If..Else to force the proper color doesn't
work.
Did Compact and repair......

Any help will; be appreciated.
 
J

JamesJ

Addendum.
This fields BackColor doesn't change color when it is in the header or
footer of the form and it
doesn't change color when I use Overlapping forms for the Current Database
only tabbed formd.

James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top