G
Guest
i have two forms, the main form and its subform. the
subform is being displayed as a continuous datasheet (oh
yeah and btw i am using A2K), and i want the color of
the 'Time_on_List' subForm control to change from black text on
white bkgrnd to yellow text on red whenever its value is
formatting (e.g. i've conditionally set the value of "Pending" in the
'Outcome' control to be displayed in Yellow w/ a Red background) but this
condition revolves around more than one control's values]
for some reason the same VBA code works on other forms (in
Form view) which are not subforms but are viewed by the
user as a main form but it has no effect on the same
control when applied in the context i've just described.
my code is below, can you point to some obvious glitch?
Private Sub Form_Current()
Dim lngRed As Long, lngYellog As Long, lngWhite As Long,
Time_on_List As Integer
lngRed = RGB(255, 0, 0)
lngBlack = RGB(0, 0, 0)
lngYellow = RGB(255, 255, 0)
lngWhite = RGB(255, 255, 255)
Me.Time_on_List = DateDiff("d", Me.Date_on_List, Now())
If Me.Time_on_List >= 30 And Me.Outcome = "Pending" Then
Me.Time_on_List.ForeColor = lngYellow
Me.Time_on_List.BackColor = lngRed
Else
Me.Time_on_List.ForeColor = lngBlack
Me.Time_on_List.BackColor = lngWhite
End If
End Sub
i tried referencing the names of the controls above using the long-winded
syntax found in KBase Article 209099 but encounter run time errors about
a2k's not finding the named form(s)????
anyone out there run 'cross this interested in chiming in?
subform is being displayed as a continuous datasheet (oh
yeah and btw i am using A2K), and i want the color of
the 'Time_on_List' subForm control to change from black text on
white bkgrnd to yellow text on red whenever its value is
subform's equal to "Pending". [yes, i do know about simple conditional= 30 AND the value of an adjacent 'Outcome' control on the same
formatting (e.g. i've conditionally set the value of "Pending" in the
'Outcome' control to be displayed in Yellow w/ a Red background) but this
condition revolves around more than one control's values]
for some reason the same VBA code works on other forms (in
Form view) which are not subforms but are viewed by the
user as a main form but it has no effect on the same
control when applied in the context i've just described.
my code is below, can you point to some obvious glitch?
Private Sub Form_Current()
Dim lngRed As Long, lngYellog As Long, lngWhite As Long,
Time_on_List As Integer
lngRed = RGB(255, 0, 0)
lngBlack = RGB(0, 0, 0)
lngYellow = RGB(255, 255, 0)
lngWhite = RGB(255, 255, 255)
Me.Time_on_List = DateDiff("d", Me.Date_on_List, Now())
If Me.Time_on_List >= 30 And Me.Outcome = "Pending" Then
Me.Time_on_List.ForeColor = lngYellow
Me.Time_on_List.BackColor = lngRed
Else
Me.Time_on_List.ForeColor = lngBlack
Me.Time_on_List.BackColor = lngWhite
End If
End Sub
i tried referencing the names of the controls above using the long-winded
syntax found in KBase Article 209099 but encounter run time errors about
a2k's not finding the named form(s)????
anyone out there run 'cross this interested in chiming in?