here goes..
there are 3 combo boxes, one for month, payperiod, and year. it's supposed to look for payroll stuff during the payperiod.
Option Compare Database
Dim begDate, lasDate As Date
Private Sub cmbMth_AfterUpdate()
FilterMonth
End Sub
Private Sub cmbyear_afterupdate()
FilterMonth
End Sub
Private Sub cmbPay_afterupdate()
If cmbPay.Value = "1-15" Then
begDate = 1
lasDate = 15
End If
If cmbPay.Value = "16-EOM" Then
begDate = 16
lasDate = Day(DateSerial(cmbYear.Value, Month(cmbMth.Value) + 1, 0))
End If
End Sub
Private Sub form_initialize()
cmbMth.Value = Month(Date)
begDate = 1
lasDate = 15
cmbYear.Value = year(Date)
End Sub
Function FilterMonth()
Dim PayPeriod As Date
PayPeriodstart = DateValue(cmbMth.Value + " " + begDate + ", " + cmbYear.Value)
PayPeriodEnd = DateValue(cmbMth.Value + " " + endDate + ", " + cmbYear.Value)
[Calc Hours subform].Filter = PayPeriodstart <= [Calc Hours subform].Form![Date] And [Calc Hours subform].Form![Date] <= PayPeriodEnd
End Function