I have the following code and it works with characters I want to change lines 9, 10 and 11 to work with a number. How do I format it to work?
Code:
Private Sub FilterOvertime_Click() On Error Resume Next Dim strSQL As String, intCounter As Integer Dim c As Access.Control 'Build SQL String For intCounter = 1 To 2 If Me("Filter" & intCounter) <> "" Then Set c = Me("Filter" & intCounter) If TypeOf c Is Access.ComboBox Then strSQL = strSQL & "[" & c.Tag & "] " & " = " & Chr(34) & c & Chr(34) & " And " ElseIf TypeOf c Is Access.TextBox Then strSQL = strSQL & "[" & c.Tag & "] " & " = " & Chr(35) & Format(c, "mm/dd/yyyy") & Chr(35) & " And " End If End If Next If strSQL <> "" Then 'Strip Last " And " strSQL = Left(strSQL, (Len(strSQL) - 5)) 'Set the Filter property Reports!rptOverTime.Filter = strSQL Reports!rptOverTime.FilterOn = True End If End Sub
Comment