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

Set background color in field

Status
Not open for further replies.

apestaarten

Technical User
Aug 20, 2008
7
NL
Hi,
In a recordset (Access 2007)I select a record using the find methode (rs.find(expession)).
I find my record and I want to change te background color of one of the fields. In my case rs!day.
I don't know how do this.
Who can help me?
regards
Apestaarten
 
I did. But the the conditional format is then dependent of an other recordset. See here under the code.
Code:
Private Sub Form_Open(Cancel As Integer)
Dim jaar As Recordset, strSQL As String, rst As Recordset
strSQL = "SELECT * FROM Jaar"
Set jaar = CurrentDb.OpenRecordset(strSQL)
strSQL = "SELECT * FROM Datum"
Set rst = CurrentDb.OpenRecordset(strSQL)
rst.MoveFirst

Do While Not rst.EOF

jaar.FindFirst "Dag = #" & Format(rst!Datum, "mm-dd-yyyy") & "#"

jaar.Edit
jaar!Opmerkingen = "Cursus gepland"
'jaar!Dag.colorindex = 5 or something like this?????????
jaar.Update
rst.MoveNext
Loop

Set rst = Nothing
Set jaar = Nothing
End Sub
 
Why do you think that a recorset has any color property ????
 
Thank you PHV,
You ask the right question. I managed to solve the problem with conditional formating.
Thanks also BUBBA100

Regards, Apestaarten
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top