I am trying to invoke a sub from another sub in Access and keep getting a "Compiler Error ByRef argument mismatch. I understand that it says the variable I am passing does not match with the one specified in the called sub. Here is my code. I have the variables firstDayOfStartMonth and firstDayOfEndMonth defined as dates and am passing them to the second proc deleteCurrentData(startDate As Date, endDate As Date).
Any help would be greatly appreciated.
Sub loadDataFromExcel()
Dim monthName1, monthName2 As String
Dim startMonth, endMonth, curMonth As Integer
Dim thisMonday, rptStartDate, rptEndDate, firstDayOfStartMonth, firstDayOfEndMonth As Date
thisMonday = Date - Weekday(Date, vbMonday) + 1
rptStartDate = thisMonday - 14
rptEndDate = thisMonday - 10
firstDayOfStartMonth = DateSerial(Year(rptStartDate), Month(rptStartDate), 1)
firstDayOfEndMonth = DateSerial(Year(rptEndDate), Month(rptEndDate), 1)
Call deleteCurrentData(firstDayOfStartMonth, firstDayOfEndMonth)
End Sub
Private Sub deleteCurrentData(startDate As Date, endDate As Date)