Hiding Text Box on Form

G

Guest

Hi all,

I have a calender that allows students to select a date, and then if they
wish to book a PC for either 'Test' or 'Primer. The form has two combo
boxes, (FilterDate & Test/Primer). In the detail section I have some time
slots in text boxes: ie. time1 - 11:00, time2 - 12:00, time3 - 17:00, time4,
18:00, time5, - 19:00. There are only certain days of the week that allow
certain Test/Primer and and time slots to be selected. The following code
from Ofer and other memebers of the group enable me to hide the Time1 and
Time2 (textboxes) etc dependant on the day of the week selected. Basically
only Time1 and Time2 are available on a Thursday. The others only being
shown on a Monday. And it works great!!

Me.Time1.Visible = (Weekday(Me.FilterDate) = Weekday(5))
Me.Time2.Visible = (Weekday(Me.FilterDate) = Weekday(5))
Me.Time3.Visible = (Weekday(Me.FilterDate) = Weekday(2))
Me.Time4.Visible = (Weekday(Me.FilterDate) = Weekday(2))
Me.Time5.Visible = (Weekday(Me.FilterDate) = Weekday(2))

However, Time7 is availble on a Monday but it finishes at 18:00 if you
select a 'PRMER' while the 'TEST version continues for an extra hour till
19:00 and therefore should be made invisible when the student has selected
'Primer' from the second combo box 'Test/Primer'. By using an AfterUpDate
Event Procedure based on the above code I did get it work but then if the
user reselects 'Test' the Time7 will not reappear as it should. The basic I
thinks is something to the following lines?

If 'Test/Primer' = "Primer", me.TestPrimer.visible=false
else TestPrimer.visible = true

Thanks for taking the time to read this if you can understand it!! Any and
all help very much welecome. Debbie D.
 
G

Guest

Hi Debbie
To acomplish that
If 'Test/Primer' = "Primer", me.TestPrimer.visible=false
else TestPrimer.visible = true
Try this

me.TestPrimer.visible = (Me.[Test/Primer] = "Primer")=False)
 
G

Guest

Ofer,

You've done it again. Thanks loads. Debbie D.

Ofer said:
Hi Debbie
To acomplish that
If 'Test/Primer' = "Primer", me.TestPrimer.visible=false
else TestPrimer.visible = true
Try this

me.TestPrimer.visible = (Me.[Test/Primer] = "Primer")=False)

--
I hope that helped
Good luck


Debbie D. said:
Hi all,

I have a calender that allows students to select a date, and then if they
wish to book a PC for either 'Test' or 'Primer. The form has two combo
boxes, (FilterDate & Test/Primer). In the detail section I have some time
slots in text boxes: ie. time1 - 11:00, time2 - 12:00, time3 - 17:00, time4,
18:00, time5, - 19:00. There are only certain days of the week that allow
certain Test/Primer and and time slots to be selected. The following code
from Ofer and other memebers of the group enable me to hide the Time1 and
Time2 (textboxes) etc dependant on the day of the week selected. Basically
only Time1 and Time2 are available on a Thursday. The others only being
shown on a Monday. And it works great!!

Me.Time1.Visible = (Weekday(Me.FilterDate) = Weekday(5))
Me.Time2.Visible = (Weekday(Me.FilterDate) = Weekday(5))
Me.Time3.Visible = (Weekday(Me.FilterDate) = Weekday(2))
Me.Time4.Visible = (Weekday(Me.FilterDate) = Weekday(2))
Me.Time5.Visible = (Weekday(Me.FilterDate) = Weekday(2))

However, Time7 is availble on a Monday but it finishes at 18:00 if you
select a 'PRMER' while the 'TEST version continues for an extra hour till
19:00 and therefore should be made invisible when the student has selected
'Primer' from the second combo box 'Test/Primer'. By using an AfterUpDate
Event Procedure based on the above code I did get it work but then if the
user reselects 'Test' the Time7 will not reappear as it should. The basic I
thinks is something to the following lines?

If 'Test/Primer' = "Primer", me.TestPrimer.visible=false
else TestPrimer.visible = true

Thanks for taking the time to read this if you can understand it!! Any and
all help very much welecome. Debbie D.
 
Top