Display Label based on Date

  • Thread starter Thread starter cmitchel via AccessMonster.com
  • Start date Start date
C

cmitchel via AccessMonster.com

Hello!

Is it possible to display a label on a form only when a date listed within a
current record is < todays date otherwise the Label would not be visible.
For instance:

A Warranty Exp Date within a record is dated as 06/01/2006...The user would
see the "Out Of Warranty" label, otherwise if the Warranty Exp Date is >=
todays date then the user would not see the "Out Of Warranty" label..

Maybe something like: On_Current

If Me.WarrantyExpDate < Date then Me.OOW.Visible = True <---------------
(Totally guessing here)
somekind of statement to make it false...

Also is it possible to make the Label Flash?

Thanks!
 
You need to ensure that the Visible property is put back to False when you
get to the next row that's okay, so use:

Me.OOW.Visible = (Me.WarrantyExpDate > Date)

Are you SURE you want a flashing label? Many users consider that very
obnoxious...

If you're determined, you can set the form's TimerInterval property to a
non-zero value, and put code in the form's Timer event to either toggle the
visibility back and forth, or to change the label's colour.

That then means that your Current event would need to be something like:

If (Me.WarrantyExpDate > Date) Then
Me.OOW.Visible = True
Me.TimerInterval = 500
Else
Me.OOW.Visible = False
Me.TimerInterval = 0
End If

and the Timer event would be something like:

Me.OOW.Visible = Not Me.OOW.Visible
 
Back
Top