I have modified the NWind (form/subform) code to suit my application.
The text box and combo box filters work great, but I need to filter records "From" and "To" dates. I have used the ActiveX DTPicker for calendar controls.

here's the code as exists:

Dim MySQL As String, MyCriteria As String, MyRecordSource As String
Dim ArgCount As Integer
Dim Tmp As Variant


ArgCount = 0


MySQL = "SELECT * FROM time_data WHERE "
MyCriteria = ""


AddToWhere [Job], "[job]", MyCriteria, ArgCount
AddToWhere [Department], "[department]", MyCriteria, ArgCount
AddToWhere [employee], "[name]", MyCriteria, ArgCount


If MyCriteria = "" Then
MyCriteria = "True"
End If



MyRecordSource = MySQL & MyCriteria


Me![time_data].Form.RecordSource = MyRecordSource


how do I use the "From" and "To" parameters with the AddToWhere?


tks
Duck