OK - I have a form with seven tickboxes - one for each day of the week - each one saved in my.settings.monday, my.settings.tuesday, etc
Now I need to check if something should happen today and the code I'm using (below) seems very longwinded. Can anyone help 'tidy it up'?!
Thanks
Code:If Now.DayOfWeek = DayOfWeek.Monday And My.Settings.monday = True Then 'do it End If If Now.DayOfWeek = DayOfWeek.Tuesday And My.Settings.tuesday = True Then 'do it End If If Now.DayOfWeek = DayOfWeek.Wednesday And My.Settings.wednesday = True Then 'do it End If If Now.DayOfWeek = DayOfWeek.Thursday And My.Settings.thursday = True Then 'do it End If If Now.DayOfWeek = DayOfWeek.Friday And My.Settings.friday = True Then 'do it End If If Now.DayOfWeek = DayOfWeek.Saturday And My.Settings.saturday = True Then 'do it End If If Now.DayOfWeek = DayOfWeek.Sunday And My.Settings.sunday = True Then 'do it End If




Reply With Quote