S
Scott A
I have some code which toggles two labels on and off based
on the date values on a continuous form using the FormLoad
event.
When the first record displayed in the continuous form
meets one of the conditions described in the procedure, it
displays the label on all of the following records whether
they meet the criteria or not. I didn't expect this and
am wondering how I should modify the code.
Here is the code...
===========================================================
Private Sub Form_Load()
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "All equipment purchased in the last 30
days has been delivered."
End If
Dim DatToday As Date
Dim ForseenDeliveryDate As Date
DatToday = Date
'Toggles Overdue label on and off
If Me![ForseenDeliveryDate] < DatToday Then
Me!txtOverdue.Visible = True
Else
Me!txtOverdue.Visible = False
End If
'Toggles Today label on and off
If Me![ForseenDeliveryDate] = DatToday Then
Me!txtToday.Visible = True
Else
Me!txtToday.Visible = False
End If
End Sub
==========================================================
Any thoughts?
Thanks,
Scott
on the date values on a continuous form using the FormLoad
event.
When the first record displayed in the continuous form
meets one of the conditions described in the procedure, it
displays the label on all of the following records whether
they meet the criteria or not. I didn't expect this and
am wondering how I should modify the code.
Here is the code...
===========================================================
Private Sub Form_Load()
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "All equipment purchased in the last 30
days has been delivered."
End If
Dim DatToday As Date
Dim ForseenDeliveryDate As Date
DatToday = Date
'Toggles Overdue label on and off
If Me![ForseenDeliveryDate] < DatToday Then
Me!txtOverdue.Visible = True
Else
Me!txtOverdue.Visible = False
End If
'Toggles Today label on and off
If Me![ForseenDeliveryDate] = DatToday Then
Me!txtToday.Visible = True
Else
Me!txtToday.Visible = False
End If
End Sub
==========================================================
Any thoughts?
Thanks,
Scott