Thank you in advance for your help.
I have a working form where I use comboboxes to filter an unbound listbox to winnow my record selection options. Everything works as expected. Now I want to create an "export" of the listbox result, by opening up a select query so that I can copy and paste it into Outlook.
As an aside, the reason I want/need to do it this way is because the output will have SharePoint hyperlinks to documents and folders, which Outlook (and only Outlook, it seems) conveniently converts the into legible titles (so you know what it is) that can be clicked on directly and it will open up the document or folder in SharePoint. If I could get an Excel export or PDF of an Access report to do this, I probably would.
Given the programming done to create and filter the rowsource for the listbox, I was hoping to use the rowsource and just open a query, like this:
I get Run-time Error 7874, "...can't find the Object 'Select....'" which I think tells me I need an Object (a query, in this case). I know I could recreate the rowsource as a query object using the parameters from the listboxes, but if there's a simpler way....Code:Private Sub cmdExport_Click() Dim strSQL as String strSQL = me.lstMaterials.Rowsource DoCmd.OpenQuery strSQL, acViewNormal End Sub