Visible If..function on text box

  • Thread starter Thread starter RachelM
  • Start date Start date
R

RachelM

Guest
I am having trouble making the Visible property of a text box work on an if..then statement. It works if I ask it to make one box visible if the other isnt. But I am trying to make it visible or invisible depending on the record count from an SQL statement. I am creating an annual Leave chart with out using ActiveX Calendar as the calendar is not flexible enough. The SQL statement seems to be the problem but it works in queries. Basically the function of the text box is it shows Leave type e.g. H for holiday, or S for sick. If field1 in the table shows a value of #01/01/00# or if field2 shows a value of #01/01/00# or if field1<#01/01/00 and field2>#01/01/00# then make the box visible. Any ideas. I have tried everything in the programming for dummies book but it just won't work.
 
How about you try this
if [fld1] = #01/01/00# OR [fld2] = #01/01/00# then
[txtLeaveType].Visible = True
ElseIf [fld1] < #01/01/00# AND [fld2] > #01/01/00# then
[txtLeaveType].Visible = True
else
[txtLeaveType].Visible = False
end if

Hope it helps

Mitch.
 

Users who are viewing this thread

Back
Top Bottom