[AccessD] using ADO to populate combos - was RE: Error3048 Cannotopen any more databases

Martin W Reid mwp.reid at qub.ac.uk
Wed Mar 5 09:24:18 CST 2008


John

You know I think we had this same conversation in 2003 (<:

Martin


Martin WP Reid
Information Services
Queen's University
Riddel Hall
185 Stranmillis Road
Belfast
BT9 5EE
Tel : 02890974465
Email : mwp.reid at qub.ac.uk
________________________________________
From: accessd-bounces at databaseadvisors.com [accessd-bounces at databaseadvisors.com] On Behalf Of jwcolby [jwcolby at colbyconsulting.com]
Sent: 05 March 2008 14:57
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] using ADO to populate combos - was RE:   Error3048       Cannotopen any more databases

Yea, but this is a value list.  I rarely if ever use value lists because of
the 2000 character limitation.


John W. Colby
Colby Consulting
www.ColbyConsulting.com
-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Martin W Reid
Sent: Wednesday, March 05, 2008 9:47 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] using ADO to populate combos - was RE: Error3048
Cannotopen any more databases

Out of the archives

if g_oConnection = OpenConenction then
     Dim oRes As ADODB.Recordset
     Dim sListText As String
     Set oRes = New ADODB.Recordset
     Me.cboMyList.ColumnCount = 2
     Me.cboMyList.BoundColumn = 1
     Me.cboMyList.ColumnHeads = False
     Me.cboMyList.ColumnWidths = "0;1"
     Me.cboMyList.RowSourceType = "Value List"
     Me.cboMyList.DefaultValue = 0
     oRes.Open "select * from tbMyTable order by label", g_oConnection,
adOpenDynamic, adLockOptimistic
     sListText = "0;'<Anything>';"
     While oRes.EOF = False
           sListText = sListText & oRes("ID").Value & ";" &
oRes("Label").Value & ";"
           oRes.MoveNext
       Wend
       oRes.Close
       Me.cboMyList.RowSource = sListText
       Set oRes = Nothing
       CloseConnection
   end if


Martin WP Reid
Information Services
Queen's University
Riddel Hall
185 Stranmillis Road
Belfast
BT9 5EE
Tel : 02890974465
Email : mwp.reid at qub.ac.uk
________________________________________
From: accessd-bounces at databaseadvisors.com
[accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins
[ssharkins at gmail.com]
Sent: 05 March 2008 14:35
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] using ADO to populate combos - was RE: Error 3048
Cannotopen any more databases

John, I think the control has a property named Recordset -- look for

Set ctl.Recordset = rst

I think you have to do this programmatically -- don't think there's a manual
choice. I might be wrong about this, I know you can do this with forms.

Susan H.


> Is it in fact possible to make the rowsource an ADO recordset or am I
> delusional?  If possible, how is it done?  Example code would be nice.

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list