View Single Post
  #1 (permalink)  
Old April 24th, 2008, 11:09 AM
camehere camehere is offline
Authorized User
Join Date: Feb 2008
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Change Textbox Backcolor for certain records only

Private Sub Form_Load()
On Error GoTo Err1
Dim rs As DAO.Recordset

    Set rs = Me.RecordsetClone
    If rs.RecordCount > 0 Then
        Do Until rs.EOF

            If ((Month(Now) = 4) And (rs!Apr = True)) Then

                   rs!Machine.BackColor = 13500152 '(How?)

            End If

    End If

    Exit Sub
    MsgBox Err.Description
    Resume Exit_Form_load
End Sub
__________________________________________________ _____________
I aim to change textbox backcolor of a field "Machine" for certain records which have fulfilled some criteria

Set the color of the textbox of field “machine” of records which shows its maintenance schedule is in april.Only those records which has schedule in april will have its corresponding record textbox “machine” set to yellow. But,I typed rs!Machine.Backcolor = 13500152, & error.How should code be?

tried Me.Machine.Backcolor = 13500152 & ended up havin all textboxes “machine” on the form set to yellow.But this is not i want as only some records should have textbox backcolor to yellow. Or any other method to achieve this?

Please help... Thank you..:D

Reply With Quote