Hiding objects on a form

  • Thread starter Thread starter mario
  • Start date Start date
M

mario

Some help please...

I have a form that I want to compare a date '[EnrollmentDate]' to the
current date. If the current date is 4 weeks after the EnrollmentDate, I
want to make a label '[lblAlert]' to become visible as I scroll through each
record from my table. The label should be hidden as I scroll through each
record unless it is after the four weeks.

Any suggestions?

Thanks in advance,
Mario
 
Mario,

I suggest changing the label to an unbound textbox, and set its Control
Source to something like...
=IIf(DateDiff("d",[EnrollmentDate],Date())>27,"RED ALERT!")
 
The logic should go in the OnCurrent Event of the form and maybe in the
AfterUpdate event of the
control for EnrollmentDate.

if DateDiff("ww",me!EnrollmentDate, Now) >3 then
Me!lblAlert.visible=true
else
Me!lblAlert.visible=false
endif

This is air code, I think I've got the DateDiff correct.
 
Thanks! I will give it a try.

Mario

Steve Schapel said:
Mario,

I suggest changing the label to an unbound textbox, and set its Control
Source to something like...
=IIf(DateDiff("d",[EnrollmentDate],Date())>27,"RED ALERT!")

--
Steve Schapel, Microsoft Access MVP

Some help please...

I have a form that I want to compare a date '[EnrollmentDate]' to the
current date. If the current date is 4 weeks after the EnrollmentDate, I
want to make a label '[lblAlert]' to become visible as I scroll through each
record from my table. The label should be hidden as I scroll through each
record unless it is after the four weeks.

Any suggestions?

Thanks in advance,
Mario
 
Thanks! I will also try this.
Mario

Ronald W. Roberts said:
The logic should go in the OnCurrent Event of the form and maybe in the
AfterUpdate event of the
control for EnrollmentDate.

if DateDiff("ww",me!EnrollmentDate, Now) >3 then
Me!lblAlert.visible=true
else
Me!lblAlert.visible=false
endif

This is air code, I think I've got the DateDiff correct.

Ron said:
Some help please...

I have a form that I want to compare a date '[EnrollmentDate]' to the
current date. If the current date is 4 weeks after the EnrollmentDate, I
want to make a label '[lblAlert]' to become visible as I scroll through each
record from my table. The label should be hidden as I scroll through each
record unless it is after the four weeks.

Any suggestions?

Thanks in advance,
Mario
 
Back
Top