Listing table names

  • Thread starter Thread starter Hammy
  • Start date Start date
H

Hammy

Guest
I am trying to create a combo box that takes it source from tables. I have a routine that moves attendance records each year into an archive table. It creates a table name 2001attendance, 2002attendance, etc.

In my combo box I want the options to only be the table that match these names. HOwever, I can't seem to find elp on creating the SQL that will dynamically grabs these tables for me.

Any help anyone?

Thanks,
Hammy
 
Use the following as the Row Source for the combobox:

SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Name) Like "*attendance") AND ((MSysObjects.Type)=1 Or (MSysObjects.Type)=6))
ORDER BY MSysObjects.Name;

RDH
 
Last edited:
Thanks!

Hammy
 

Users who are viewing this thread

Back
Top Bottom