When I run the below code, it modifys the query but it puts the form criteria as the parameter and not the literal values. How do I re-write this so the criteria for TransDate becomes Between 7/11/2011 and 7/12/2012 instead of: Between [Forms]![F_PRINT_ACTIVITY]![t_start] And [Forms]![F_PRINT_ACTIVITY]![t_end])
Thanks
Set qdf = CurrentDb.QueryDefs("Q_RECEIVING_ACTIVITY_REPORT_XLT") ssql = "SELECT * From Q_RECEIVING_ACTIVITY_REPORT " & vbCrLf ssql = ssql & "WHERE(TransDate Between [Forms]![F_PRINT_ACTIVITY]![t_start] And [Forms]![F_PRINT_ACTIVITY]![t_end])" qdf.sql = ssql
http://www.w3schools.com/Vbscript/func_dateadd.asp
If memory serves, Access supports DateAdd..
That should do it..
HTH,
Kent