stSQL = CurrentDb.QueryDefs(Me.RecordSource).sql
stSQL = Replace(stSQL, “##AcctPeriod_From##”, frm.Controls(“AcctPeriod_From”))
stSQL = Replace(stSQL, “##AcctPeriod_To##”, frm.Controls(“AcctPeriod_To”))
stSQL = Replace(stSQL, “##Product##”, frm.Controls(“Product”))
‘Me.Controls(“Month”).Caption = frm.Controls(“AcctPeriod_To”) – Date(frm.Controls(“AcctPeriod_From”)
Dim AcctPeriod_Count As Long, Temp As Long, Ap_F As Date, Ap_T As Date, C As Date
Temp = frm.Controls(“AcctPeriod_From”)
Ap_F = Left$(Temp, 4) & “/” & Mid$(Temp, 5, 2)
Temp = frm.Controls(“AcctPeriod_To”)
Ap_T = Left$(Temp, 4) & “/” & Mid$(Temp, 5, 2)
AcctPeriod_Count = DateDiff(“M”, Ap_F, Ap_T)

點閱: 0