Set value of text box based upon value in another field

  • Thread starter Thread starter scott
  • Start date Start date
S

scott

I have a report "rptMoveDates" that has a
field "MoveCDate" that contains dates of office items
that are moving. If the date is 1/1/04 or earlier the
item is not moving and being listed for inventory
purposes. I have a text box "txtMoveStatus" that I would
like to set the value of to "Moving" if MoveCDate is
later than 1/1/04 or "Not Moving" if MoveCDate is earlier
than 1/1/04, or "PlaceHolder" if MoveCDate is = 7/4/04.
Is this possible using the afterupdate property of
MoveCDate and would it be an IF/Then type of statement?
Any help would be appreciated. Thank you. - scott
 
scott said:
I have a report "rptMoveDates" that has a
field "MoveCDate" that contains dates of office items
that are moving. If the date is 1/1/04 or earlier the
item is not moving and being listed for inventory
purposes. I have a text box "txtMoveStatus" that I would
like to set the value of to "Moving" if MoveCDate is
later than 1/1/04 or "Not Moving" if MoveCDate is earlier
than 1/1/04, or "PlaceHolder" if MoveCDate is = 7/4/04.
Is this possible using the afterupdate property of
MoveCDate and would it be an IF/Then type of statement?
Any help would be appreciated. Thank you. - scott

The easiest way is to have the query calculate the result.

Open your query for the report. If there is not a column with
"MoveCDate" in it, drag it down to the grid. In an empty column paste
this IIF formula: (should be one line)

MoveStatus:
IIF(MoveCDate=#7/4/04#,"PlaceHolder",IIF(MoveCDate<#1/1/04#,"Not
Moving","Moving"))

On the report, set the control source for the control "txtMoveStatus" to
MoveStatus.

HTH
 
Back
Top