I don't know if someone out there someday needed to do this, but because i did, this is the way:
Use the following SQL statements as Rowsource for the control depending on which object you want.
[color red]Tables[/color]
SELECT MSysObjects.Name FROM MsysObjects WHERE (Left$([Name],4) <> "Msys") AND (MSysObjects.Type)=1 ORDER BY MSysObjects.Name
[color red]Queries[/color]
SELECT MSysObjects.Name FROM MsysObjects WHERE (Left$([Name],1)<>"~") AND (MSysObjects.Type)=5 ORDER BY MSysObjects.Name
[color red]Forms[/color]
SELECT MSysObjects.Name FROM MsysObjects WHERE (MSysObjects.Type)=-32768 ORDER BY MSysObjects.Name
[color red]Reports[/color]
SELECT MSysObjects.Name FROM MsysObjects WHERE (MSysObjects.Type)= -32764 ORDER BY MSysObjects.Name
[color red]Macros[/color]
SELECT MSysObjects.Name FROM MsysObjects WHERE (MSysObjects.Type)= -32766 ORDER BY MSysObjects.Name
[color red]Modules[/color]
SELECT MSysObjects.Name FROM MsysObjects WHERE (MSysObjects.Type)= -32761 ORDER BY MSysObjects.Name
Notes:
1) In case of Tables we want NOT to appear the system tables that start with MSys
2) In case of Queries we exclude the "~" character because in other case the combo box shows objects starting with the "~" char.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.