Access VBA Function ByReference
' Argument strWeekdayName can be changed inside the function. Public Function IsToday(ByRef strWeekdayName As String) As Boolean ' If the weekday passed in is equal to today's weekday name, return True. If strWeekdayName = WeekdayName(Weekday(Date)) Then ' Explicit return value IsToday = True Else ' If it does not equal to today's weekday name, return today's weekday name by assigning ' today's weekday name to the argument. strWeekdayName = WeekdayName(Weekday(Date)) ' Explicit return value IsToday = False End If End Function