hi
i have a continious form with the fields
year || Qtr 1 || Qtr 2 || Qtr3 | etc.. || Qtr12
----------------------------------------------------------
2000 4 5 2 6
2001 3 3 6 2
2002 6 4 3 3
the Qtr are the months, so
Qtr 1 = January Qtr 2 = ... Qtr 12 = December
the numbers are customers that visit the office that month
i want example:
to double click on Qtr 1 / 2001 which is 3 and open form customer and see only the customers that visit the office from 1/1/2001 until 31/1/2001
i manage to make it work , with this code:
Option Compare Database
Option Explicit
Private Sub Qtr_1_DblClick(Cancel As Integer)
Dim YearTake As String
YearTake = Me.Year
DoCmd.OpenForm "customers", , , "[customers_date_visit] Between #" & "1/1/" & YearTake & "# And #" & "31/1/" & YearTake & "#"
End Sub
Private Sub Qtr_2_DblClick(Cancel As Integer)
Dim YearTake As String
YearTake = Me.Year
DoCmd.OpenForm "customers", , , "[customers_date_visit] Between #" & "1/2/" & YearTake & "# And #" & "31/2/" & YearTake & "#"
End Sub
Private Sub Qtr_3_DblClick(Cancel As Integer)
Dim YearTake As String
YearTake = Me.Year
DoCmd.OpenForm "customers", , , "[customers_date_visit] Between #" & "1/3/" & YearTake & "# And #" & "31/3/" & YearTake & "#"
End Sub
Private Sub Qtr_4_DblClick(Cancel As Integer)
Dim YearTake As String
YearTake = Me.Year
DoCmd.OpenForm "customers", , , "[customers_date_visit] Between #" & "1/4/" & YearTake & "# And #" & "31/4/" & YearTake & "#"
End Sub
etc Qtr...
BUT
i face :
1)the qtr 2 which is the second month of the year (February) has every year different number of days.
2)when i click qtr 3 it brings all the records from qtr 1 + qtr 2 + qtr 3
the same does when i click qtr 4 , qtr 5, ...qtr 12
it brings the sum of all the previous months.???
the only one that works fine is qtr 1 which is the first month...
i have a continious form with the fields
year || Qtr 1 || Qtr 2 || Qtr3 | etc.. || Qtr12
----------------------------------------------------------
2000 4 5 2 6
2001 3 3 6 2
2002 6 4 3 3
the Qtr are the months, so
Qtr 1 = January Qtr 2 = ... Qtr 12 = December
the numbers are customers that visit the office that month
i want example:
to double click on Qtr 1 / 2001 which is 3 and open form customer and see only the customers that visit the office from 1/1/2001 until 31/1/2001
i manage to make it work , with this code:
Option Compare Database
Option Explicit
Private Sub Qtr_1_DblClick(Cancel As Integer)
Dim YearTake As String
YearTake = Me.Year
DoCmd.OpenForm "customers", , , "[customers_date_visit] Between #" & "1/1/" & YearTake & "# And #" & "31/1/" & YearTake & "#"
End Sub
Private Sub Qtr_2_DblClick(Cancel As Integer)
Dim YearTake As String
YearTake = Me.Year
DoCmd.OpenForm "customers", , , "[customers_date_visit] Between #" & "1/2/" & YearTake & "# And #" & "31/2/" & YearTake & "#"
End Sub
Private Sub Qtr_3_DblClick(Cancel As Integer)
Dim YearTake As String
YearTake = Me.Year
DoCmd.OpenForm "customers", , , "[customers_date_visit] Between #" & "1/3/" & YearTake & "# And #" & "31/3/" & YearTake & "#"
End Sub
Private Sub Qtr_4_DblClick(Cancel As Integer)
Dim YearTake As String
YearTake = Me.Year
DoCmd.OpenForm "customers", , , "[customers_date_visit] Between #" & "1/4/" & YearTake & "# And #" & "31/4/" & YearTake & "#"
End Sub
etc Qtr...
BUT
i face :
1)the qtr 2 which is the second month of the year (February) has every year different number of days.
2)when i click qtr 3 it brings all the records from qtr 1 + qtr 2 + qtr 3
the same does when i click qtr 4 , qtr 5, ...qtr 12
it brings the sum of all the previous months.???
the only one that works fine is qtr 1 which is the first month...