Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Population a Combo Box with Tables names 1

Status
Not open for further replies.

jbranero

Technical User
Jun 3, 2005
17
US
I need to use cambo boxes in a form to open tables... Does anybody know how to populate this combo boxes with tables names.
 


Hi,

Either the AddItem method or, it you are using Excel, assign a range name or range referene to the listfillrange.

Skip,

[glasses] [red]Be advised:[/red]When Viscounts were guillotined just as they were disclosing where their jewels were hidden, it shows to go that you should...
Never hatchet your Counts before they chicken! [tongue]
 
If in access, you may set the RowSource property to:
SELECT [Name] FROM MSysObjects WHERE [Name] Not Like 'MSys*' AND [Type] In (1,4)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks SkipVought, it sound good the "AddItem". I have been looking the syntax and I would like to know how to get the names of the tables from the DataBase (I am in Access)
 
I would like to know how to get the names of the tables from the DataBase
Have you tried my suggestion ?
You may also consider enumerate the CurrentDB.TableDefs collection.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
No PHV, i was trying the one from SkipVought and didn't try yours. But this about the CurrentDB.tableDefs looks very good. I will try now.
Thanks a lot.
 
Hello there, I keep trying to read the names of the tables from the DB but I can not.
I use the CurrentDB object (PH suggestion) and there is a Collection (or object) called Tabledefs and in TableDefs there is another one called Item from 1-9 (that contain the names and other fields) but when I try to reference like "CDB!TDefs!Item1" it doesn't work. If I would can do that I will check for the attribute and if the Attribute = 0 this means is a table, so I can take this string.
I am sure there is an easy way to do that but this morning I cann't find it.
Any help over there?
 
Anyway, have you tried my first suggestion (it's the simplest).

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PH, I am sorry if look too novice, but is real.
What will be Name and Type in your suggestion

SELECT [Name] FROM MSysObjects WHERE [Name] Not Like 'MSys*' AND [Type] In (1,4)

thanks
 
The whole line is the RowSource of the combo (ie a SQL instruction) provided the RowSourceType is Table / Query.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PH, thans a lot, it works perfectly. i regret not to see this from the very beggining. I thought the other way was easier.
Thanks again.
 
Hi there, I am in novice trouble again.
I made a form, a very simple one, that have to combo boxes with names of tables. When the user choose the tables he want to work with he should make a click to start the proccess.
The point is that I try to pass the name of the choosen table to a procedure and it doesn't work.
I passed the arguments as the name that appear in the Other tab in the properties and as I said, it doesn't work.
The message said that:
Procedure declaration does not match description of event...bla, bla.
I checked the names of arguments and procedure and every thing is correct.
Any suggestion please
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top