I was wondering how to do DateAdd in Vba, here my unsuccessful attempt:
Needless to say I was prompted for IntervalType and StartDate. Bother!
Simon
Code:
Function DayofWeekLookup()
Dim MyControl As Control
Set MyControl = Screen.ActiveControl
With CodeContextObject
Dim IntervalType As String
Dim StartDate As Date
IntervalType = "d"
StartDate = .[Start Date]
MyControl.RowSource = "SELECT DateAdd(IntervalType,[dayofweekoffset],StartDate) AS TimeSheetDate FROM tblDaysofWeek;"
End With
End Function
Needless to say I was prompted for IntervalType and StartDate. Bother!
Simon