I've taken a MS template and modified for my purposes. Now that I have it just about where I want it I'm going through each form, after having backed up the data base, and converting macros to VBA. One macro for searching several fields in a record set doesn't quite work. The macro worked flawlessly. THE VBA doesn't give an error. After entering your criteria and clicking the button to search it filters out the entire record set. The buttons to show all records or remove the filters do so and restore the entire record set.
This macro came with the template and has only been modified due to different fields being used. The converted code is below.
Private Sub cmdGo_Click()
On Error GoTo cmdGo_Click_Err
If (Eval("[Forms]![Promotion List]![SearchBox] Is Null")) Then
DoCmd.RunCommand acCmdRemoveFilterSort
DoCmd.SetProperty "cmdShowAll", acPropertyEnabled, "0"
End
End If
TempVars.Add "strSearch", Replace(Forms![Promotion List]!SearchBox, """", """""")
TempVars.Add "strFilter", "([Member Name] Like "" * " & [TempVars]![strSearch] & " * "" )"
TempVars.Add "strFilter", TempVars!strFilter & " OR ([Rank] Like "" * " & [TempVars]![strSearch] & " * "" )"
TempVars.Add "strFilter", TempVars!strFilter & " OR ([Description] Like "" * " & [TempVars]![strSearch] & " * "" )"
TempVars.Add "strFilter", TempVars!strFilter & " OR ([RankTitle] Like "" * " & [TempVars]![strSearch] & " * "" )"
DoCmd.ApplyFilter "", TempVars!strFilter, ""
TempVars.Remove "strFilter"
TempVars.Remove "strSearch"
DoCmd.SetProperty "cmdShowAll", acPropertyEnabled, "1"
cmdGo_Click_Exit:
Exit Sub
cmdGo_Click_Err:
MsgBox Error$
Resume cmdGo_Click_Exit
End Sub
Any suggestions to resolve this are appreciated.