Private Sub btnquery_Click()
Dim strWhere As String
If IsNull(Me.SQLField) Or IsNull(Me.SQLValue) Then
strWhere = "true "
Else
strWhere = Me.SQLField & "Between #" & Me.txtStartDate & "# And #" & Me.txtEndDate & "#"
End If
Me.formsql.Form.Filter = strWhere
Me.formsql.Form.FilterOn = True
End Sub