change colour of text when a record is selected

Emma

Registered User.
Local time
Today, 04:23
Joined
May 11, 2000
Messages
37
If I use a combo box to go to a particular reocord in on a list of records, how do I change the colour of that records text so that it stands out from the rest of the records?

My code for the combo is:

Sub Combo44_AfterUpdate()
Detail.Visible = True
' Find the record that matches the control.
Me.RecordsetClone.FindFirst "[OBJECT_NO] = " & Me![Combo44]
Me.Bookmark = Me.RecordsetClone.Bookmark
DoCmd.GoToControl "object_no"
End Sub

As my form is a tabluated form, I could do with either hiding all the records that are not selected using the above, or by highlighting all the fields in the selected record?

Any ideas would be gratefully received!

Thanks and merry christmas to everyone!

Emma
 
Emma, you can change a color of the font with this object_no.ForeColor = vbRed.

You can also do the same thing with the .BackColor.
 
Thanks for your reply!

I think what I was wondering whether I could set this property (forecolor) for the whole record, rather than just one field? So not only would the Object_no field be set to a particular colour, but also all the fields in that record? Is there some sort of global command that I can set that says for selected record set the forecolor property to a particular colour? I suppose I can set each field's properties to the color, it just seems a long way round?

Many thanks
Emma
 

Users who are viewing this thread

Back
Top Bottom