visible based on value

M

Martin

Hello,

I have a form based on a query, based on a table with every date in 2009 and
2010 in the first column and usernames in the subsequent columns, so there
are 2 X 365 rows in total. I also have another column that shows what day
the date is, this is called "Day" column. I want to disable the control for
those rows where the day is a Saturday or Sunday.

I have this code in the form load event:

Private Sub Form_Load()

If Me.Day.Value = "Saturday" Then Me.MyComboBox.Visible = False

End Sub

I thought this would work but nothing happens. Can anyone help?

Many thanks in advance.

Martin
 
A

Allen Browne

Use the form's Current event.

BTW, you don't need to store the Day value in your table. Access can figure
it out for you:
Weekday([TheDateField])

Also, if this form is shown in Continuous or Datasheet view, the field will
disappear in all rows (not just the current row.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top