G Guest Jan 2, 2004 #1 I was wondering if there was a way of displaying a listing of the tables in a database in a list box.
I was wondering if there was a way of displaying a listing of the tables in a database in a list box.
J JSand42737 Jan 2, 2004 #2 =?Utf-8?B?YW5ub255bW91cw==?= said: I was wondering if there was a way of displaying a listing of the tables in a database in a list box. Click to expand... There are 3 different ways of doing this. Firstly, you can query the MSysObjects table, which is a system table, to return all tables. Secondly, you can use the database's TableDefs collection to build up the RowSource for the list box. Thirdly, you can use a user-defined function, again using the TablDefs collection. For code examples of all three methods, together with an Access 97 sample database, have a look at http://www.applecore99.com/frm/frm029.asp.
=?Utf-8?B?YW5ub255bW91cw==?= said: I was wondering if there was a way of displaying a listing of the tables in a database in a list box. Click to expand... There are 3 different ways of doing this. Firstly, you can query the MSysObjects table, which is a system table, to return all tables. Secondly, you can use the database's TableDefs collection to build up the RowSource for the list box. Thirdly, you can use a user-defined function, again using the TablDefs collection. For code examples of all three methods, together with an Access 97 sample database, have a look at http://www.applecore99.com/frm/frm029.asp.
J Jonathan Parminter Jan 4, 2004 #3 -----Original Message----- I was wondering if there was a way of displaying a Click to expand... listing of the tables in a database in a list box. . Click to expand... Hi, use online help to lookup AllTables collection and rowsource for listboxes. Use the following as an example. Dim obj As AccessObject dim strList as string For Each obj In currentdb.AllTables strList=strList & chr(34) & obj.name & chr(34) & ";" Next obj ' remove extra semi-colon if len(strList)>0 then strList=left(strList,len(strList)-1) end if lstTable.rowsource=strList remember to set lstTable.rowsourcetype to value list Luck Jonathan
-----Original Message----- I was wondering if there was a way of displaying a Click to expand... listing of the tables in a database in a list box. . Click to expand... Hi, use online help to lookup AllTables collection and rowsource for listboxes. Use the following as an example. Dim obj As AccessObject dim strList as string For Each obj In currentdb.AllTables strList=strList & chr(34) & obj.name & chr(34) & ";" Next obj ' remove extra semi-colon if len(strList)>0 then strList=left(strList,len(strList)-1) end if lstTable.rowsource=strList remember to set lstTable.rowsourcetype to value list Luck Jonathan
A anonymous Jan 5, 2004 #4 Thank you for your help -----Original Message----- I was wondering if there was a way of displaying a Click to expand... listing of the tables in a database in a list box.
Thank you for your help -----Original Message----- I was wondering if there was a way of displaying a Click to expand... listing of the tables in a database in a list box.