Reputation: 39
i get
Error 3075 Data type mismatch in criteria expression
but i no able left it
what is the problem???
but DateCutting is Integer Type
Dim strCriteria, task As String
strCriteria = "([DateCutting]>= #'" & Me.txtfrom & "'# And [DateCutting]<=#'" & Me.txtto & "')#"
task = "select * from Cutting where [DateCutting]>= '" & strCriteria & "'"
DoCmd.ApplyFilter task
Upvotes: 0
Views: 59
Reputation: 55831
Change DateCutting to DateTime and adjust your criteria:
Dim strCriteria As String
strCriteria = "[DateCutting] >= #" & Format(Me.txtfrom, "yyyy\/mm\/dd") & "# And [DateCutting] <= #" & Format(Me.txtto, "yyyy\/mm\/dd") & "#"
DoCmd.ApplyFilter strCriteria
To find a number:
strCriteria = "[Number] = " & Me.txtNumber & ""
as text:
strCriteria = "[TextNumber] = '" & Me.txtNumber & "'"
Upvotes: 2