The problem is, I don't totally follow what they are saying.
Here is the issue
Someone needed a report to show issues in a an access thing (db, app, dbms) by class. so I built a parameter query, then I built a report to call that. No problems. Now I would like to take it a step further.
Build a form with a listbox that shows the values for class but is bound by the number that is used to reference it in my other tables, when the user clicks the command button, whatever is selected in the box is used in place of the parameter on the query, no little popup box or anything.
Now the two links pasted above seem to indicate that I can't do it quite that way but that I would have to us the "on Build" event of the report to call a stored procedure. Does that seem like the most correct path?
Also, since I am still fussing with this, if a user selects multiple values, what is passed?
Guidance is appreciated.
I don't know if you can adapt this to your needs or not, but I created a search form a while back for a dB I was working on. It allowed the user to select multiple items from a listbox for criteria for a search (also allowing the user to search by date range, key word/phrase, etc., but that's unimportant to the issue at hand). Here's a snippet of the code I used for that that you might be able to use:
Dim frm As Form, ctl As Control, varItm As Variant, strTemp As String, _
i As Integer, intMax As Integer, blnAnySelected As Boolean
Set frm = Forms!FrmName
blnAnySelected = False
i = 0
intMax = Me.LstBoxName.ListCount
For i = 0 To intMax
If Me.LstBoxName.Selected(i) Then
blnAnySelected = True
If blnAnySelected Then
strTemp = "("
Set ctl = frm!LstBoxName
For Each varItm In ctl.ItemsSelected
If strTemp <> "(" Then strTemp = strTemp & " OR "
strTemp = strTemp & "(TblName.[FldName]) = '" & ctl.ItemData(varItm) & "'"
strTemp = strTemp & ")"
If strWHERE <> "" Then strWHERE = strWHERE & " AND "
strWHERE = strWHERE & strTemp
DoCmd.OpenReport "RptName", acViewPreview, , strWHERE
DoCmd.SelectObject acReport, "RptName"
nice, It's gonna take me a while to break that down into something I understand but I appreciate it. There will be many more filter and searchs to come and it looks like your code addresses some of those issues I haven't even gotten to yet.