The code below is fired by a command button on a "menu" form
Code:
Sub Comparisons()
Dim FROM1 As Date
Dim FROM2 As Date
Dim TO1 As Date
Dim TO2 As Date
Dim strSQL As String
Dim strSQL2 As String
FROM1 = InputBox("Enter Date from")
TO1 = InputBox("Enter Date to")
FROM2 = DateAdd("yyyy", -1, CDate(FROM1))
TO2 = DateAdd("yyyy", -1, CDate(TO1))
Call addBudget(FROM1)
What I am trying to do is to enable the user to select any period , FROM1 to TO1, then derive the same period from last year FROM2 and TO2, and then get the relevant budget figures, link them all up by the concatenated string I have talked about and produce a report comparing sales by catagory for a period this year, the same period last year and the budgeted sales for the same period.
John