Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.
Set Me.lstResults.Recordset = rs
. I am trying to get the ADO Recordset based on a SQL stored procedure to appear in an unbound Listbox or Subform of an Access form. I’m on Win 7 Machine using Access 2010 connecting to SQL Server 2008:
Set Me![frmM_SearchForDocumentsSubForm].Form.Recordset = rs
Private Sub cmdRun_Click() 'On Error Resume Next Dim strSQL As String 'Stored procedure + parameters called from form strSQL = "Exec sqlsp_searchalltables " & Me.txtTables & _ ", " & "'%" & Me.txtSearchTerm & "%'" OpenMyRecordset rs, strSQL 'debug - view procedure Me.lblQuery.Caption = strSQL Me.Repaint Set Me.lstResults.Recordset = rs 'or this 'Set Me![frmM_SearchForDocumentsSubForm].Form.Recordset = rs End Sub
With Me.lstResults Do strItem = rs.Fields("CLIENT_ID").Value .AddItem strItem rs.MoveNext Loop Until rs.EOF End With
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.