meiteniite89
New member
- Local time
- Today, 13:13
- Joined
- Aug 13, 2020
- Messages
- 23
Hello,
I have been creating Access database for some time now and now I came across the issue I cannot find the answer for.
I am trying to create a multifield search on my Form. I did it before with just using Macros, but it has limited me to only 3 fields, now I need to add more.
My code so far looks like this:
Private Sub cmdFilter_Click()
On Error GoTo cmdFilter_Click_Err
DoCmd.ApplyFilter "", "[DB type] Like ""*"" & [Forms]![SearchResult]![FilterDBtype] & ""*""" _
And "[GaugeNum] Like "" * "" & [Forms]![SearchResult]![FilterGaugeNum] & "" * """ _
And [GaugeSerialNum] Like "" * "" & [Forms]![SearchResult]![FilterSerialNum] & "" * """, """
DoCmd.SetOrderBy "GaugeNum", ""
cmdFilter_Click_Exit:
Exit Sub
cmdFilter_Click_Err:
MsgBox Error$
Resume cmdFilter_Click_Exit
End Sub
And when click Search button it gives me an error "Type Mismatch" and I am stuck. Any help, suggestions would be welcome.
I have been creating Access database for some time now and now I came across the issue I cannot find the answer for.
I am trying to create a multifield search on my Form. I did it before with just using Macros, but it has limited me to only 3 fields, now I need to add more.
My code so far looks like this:
Private Sub cmdFilter_Click()
On Error GoTo cmdFilter_Click_Err
DoCmd.ApplyFilter "", "[DB type] Like ""*"" & [Forms]![SearchResult]![FilterDBtype] & ""*""" _
And "[GaugeNum] Like "" * "" & [Forms]![SearchResult]![FilterGaugeNum] & "" * """ _
And [GaugeSerialNum] Like "" * "" & [Forms]![SearchResult]![FilterSerialNum] & "" * """, """
DoCmd.SetOrderBy "GaugeNum", ""
cmdFilter_Click_Exit:
Exit Sub
cmdFilter_Click_Err:
MsgBox Error$
Resume cmdFilter_Click_Exit
End Sub
And when click Search button it gives me an error "Type Mismatch" and I am stuck. Any help, suggestions would be welcome.