I have a form with a listbox titled "CostReportAppealsWindow." When the form loads, I want to populate the listbox with data from a query titled "CostReportAppealsSplashQ". In doing so, I want to apply a filter to a field titled "Status," which can have one of four values: "Pending Paralegal Review, "Pending Associate Review", "Pending Partner Review" or "Complete". On form load, I want to filter out the "Complete" files. (I intend to make a toggle button to make the completes viewable after I figure out the Where statement logic.)
Here's the code that I built to acheive the desired outcome.
Code:
Private Sub Form_Load()Me.CostReportAppealsWindow.RowSource = ""
Dim strSource As String
Dim rc As String
rc = "Review Complete"
strSource = "SELECT CostReportAppealID, [Appeal Deadline], CCN, [Hospital Name], FYE, [Issue Name], [Client Name], [Designated Paralegal], [Designated Attorney], [Status] " & _
"FROM [CostReportAppealsSplashQ]" & _
"Where [Status] <> '*" & rc & "*' "
Me.CostReportAppealsWindow.RowSource = strSource
End Sub
The listbox populates just fine, but it does not apply the filter. "Review Complete" files appear in the listbox. Do I need to change the Where logic? I thought I was following the standard procedure for string query criteria. I researched this for a bit but couldn't find quite what I'm looking for. Any guidance would be greatly appreciated.