Re: How to display a query in a list box using a record set?



jim Bob wrote:
> Can someone help? I need to execute
> strSQL = "SELECT * FROM qry_viewFDOExport" when a button is pressed
> and the results displayed in a list box.
>
> I want to do something like
> Dim db As Database
> Dim rs As Recordset
> Set rs = db.OpenRecordset(strSQL) etc and then loop through all the
> results but I'm getting my head all mixed up with all the different
> ways of opening/creating a recordset.
> Thanks.
>
> *** Sent via Developersdex http://www.developersdex.com ***

Why don't you just use...

Me!ListBoxName.RowSource = "SELECT * FROM qry_viewFDOExport"


--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


.



Relevant Pages

  • Re: Help Getting .RecordCount from Stored Proc
    ... I am using VB 6 to execute a stored proc, ... I created a connection, command, and recordset with ADO. ... > Dim cnn1 As ADODB.Connection ... > Dim cmdProvider As ADODB.Command ...
    (microsoft.public.vb.database.ado)
  • Re: DAO peculiarity in A97?
    ... If BOF is True then you won't execute the statements inside the ... If..Then becuase you have told it to continue only if the opposite of BOF is ... only thing you do with it is open a recordset. ... This will force you to DIM each variable you ...
    (comp.databases.ms-access)
  • Re: ADO cloned recordset doesnt return field names
    ... It had been awhile since I worked with ADO. ... need to specifically loop through the recordset and use ".Name" to get at the ... >> I am using the following function to execute an ADO query. ... > Dim rs As ADODB.Recordset ...
    (microsoft.public.excel.programming)
  • Help Getting .RecordCount from Stored Proc
    ... I am using VB 6 to execute a stored proc, ... I created a connection, command, and recordset with ADO. ... Dim cnn1 As ADODB.Connection ... Dim cmdProvider As ADODB.Command ...
    (microsoft.public.vb.database.ado)
  • Re: access 2003
    ... Dim ctl As Control ... Dim rs As Recordset ... This sets the query definitions for choosing data to create an invoice using ... Event on combo box: Private Sub ChooseCust_AfterUpdate ...
    (microsoft.public.access.conversion)