Making 1 of 2 text boxes visible depending upon results

  • Thread starter Thread starter CAM
  • Start date Start date
C

CAM

Hello,

I have 2 text boxes in my form one call [txtdaysCount] and [txtmessage],
which I only want one of them to appear based on a result in the form
inputted by the user. For example within the form there are two additional
text boxes [opened date] and [due date] that the user inputs. I want the
[txtdaysCount] appear only when it calculates the date difference [opened
date]-[due date] when its greater then 0 else [txtmessage] will appear
instead and [txtdaysCount] will not appear. How do I get this result when
the user scroll to the next record. Thank you in advance.
 
CAM,

The simplest way to do this would be to just use one textbox, not two,
instead of [txtdaysCount] and [txtmessage]. And in the Control Source
of this textbox you can use like this...
=IIf([opened date]>[due date],[opened date]-[due date],"my message")

Otherwise you would need to use code on the Current event of the form,
and also probably the After Update events of the date controls, to
toggle the Visible property of the other textboxes.
 
Back
Top