Everything you need to know about backup and disaster recovery with AWS, for FREE!
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.
|Append multiple Excel workbooks with multiple sheets into a new workbook||44||87|
|Why is this SQL bringing back extra rows? (parsing XML data)||4||36|
|SQL Server maintenance plan not deleting backup files as anticipated||4||17|
|getting error while running below query in sql||2||14|