conditional display

  • Thread starter kryszystof via AccessMonster.com
  • Start date
K

kryszystof via AccessMonster.com

hello to all,

i have a form, very simple, that has a field that needs to appear and
disappear based on another fields data.
ie: i have a calculated field, a percentage, that if a date was before
01/01/2002, the calculated field would have its visible setting to no. now,
it got the visible property correct, but if you scroll through the records
(my form has 1 record per page), the last visible property stays, even if the
criteria is is met for no visible. how do i make my criteria react to each
record differently?

if have for code:
if hire_date >= 1 / 1 / 2002 Then
first_adj.Visible = True
Else
first_adj.Visible = False
End if

i have this for form open and also my change() for primary key. (that is so
it is based on a permanent field)

Very Much TIA,
~K
 
R

Rick B

If you want it to check this as you move from one record to another, then
you need to put the code in the form's CURRENT event. That code fires when
you move from one record to another.
 
K

kryszystof via AccessMonster.com

Thanks, that seems to work ok.

Rick said:
If you want it to check this as you move from one record to another, then
you need to put the code in the form's CURRENT event. That code fires when
you move from one record to another.
hello to all,
[quoted text clipped - 19 lines]
Very Much TIA,
~K
 
K

Klatuu

Put this in the current event of the form. One thing to be aware of. If
hire_date is a table field of Date data time, then use the second line:

first_adj.Visible = hire_date >= 1 / 1 / 2002

first_adj.Visible = hire_date >= #1 / 1 / 2002#
 
Top