To whomever can help me,
I am building a work calendar and want to block out the holidays. I created a ListHoliday Table, in which I have listed all holidays for the year in the column called HOLIDAY. Now in my calendar I want that day blocked out (invisible). However, in my Do Loop somehow it's not doing it. I think it's because my format is not correct. I'm thinking it's an easy fix, but since I'm new to VB I got stuck. Please help! Below is my code ("workdate" is the current date on the calendar):
sqlhol = "SELECT * FROM ListHolidays;"
Set dbhol = CurrentDb()
Set rshol = dbhol.OpenRecordset(sqlhol, dbOpenSnapshot)
Do Until rshol.EOF
If workdate = rshol!HOLIDAY Then
f("TextboxA").Visible = False
f("TextboxB").Visible = False
Else
f("TextboxA").Visible = True
f("TextBoxB").Visible = True
End If
rshol.MoveNext
Loop
rshol.Close
dbhol.Close
I am building a work calendar and want to block out the holidays. I created a ListHoliday Table, in which I have listed all holidays for the year in the column called HOLIDAY. Now in my calendar I want that day blocked out (invisible). However, in my Do Loop somehow it's not doing it. I think it's because my format is not correct. I'm thinking it's an easy fix, but since I'm new to VB I got stuck. Please help! Below is my code ("workdate" is the current date on the calendar):
sqlhol = "SELECT * FROM ListHolidays;"
Set dbhol = CurrentDb()
Set rshol = dbhol.OpenRecordset(sqlhol, dbOpenSnapshot)
Do Until rshol.EOF
If workdate = rshol!HOLIDAY Then
f("TextboxA").Visible = False
f("TextboxB").Visible = False
Else
f("TextboxA").Visible = True
f("TextBoxB").Visible = True
End If
rshol.MoveNext
Loop
rshol.Close
dbhol.Close