list of tables in currentdb in a listbox ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hello all,
i'm trying to display a list of tables in a listbox.
it is my idea that you can delete the tables with a delete button or with
a doubleclick action.
what i did upto now was something with tabledefs.count and tabledefs.name
but i have trouble with updating the list. i tried a tempory table but no
succes yet.
does anybody have an idea or suggestions ?
greetings and thanks, johan.
 
Johan,

Set the listbox's Rowsource property to:

SELECT Name FROM MSysObjects WHERE Type In (1, 6) AND Name Not Like "MSys*"

HTH,
Nikos
 
Use the following query as the row source:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE MSysObjects.Name Not Like "msys*"
AND MSysObjects.Type In (1,4,6)
ORDER BY MSysObjects.Name
 
thank you both for the code.
that looked simple ! i guess i'll have to spend more time with studying SQL,
because it's a lot powerfuller than i thought. the code looks so simple....
i tried it and it worked fine, although my main problem still isn't over yet.
after i delete the table i got : #deleted# instead of the tablename in the
list.
what i wanted to achieve was that the list was updated after i delete the
table.
when i click on the delete button on my form, i will get an msgbox wit
vbokcancel,
do i have to repeat the sql code after clicking the okbutton ?
or am i on the wrong track again ?
many, many thanks and greetings johan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top