Report names in listbox

K

Ken Warthen

I recently upgraded to Access 2007 and am having some trouble with the
changes. I have a form with a listbox in which I would like to display the
names of all the reports in the database. I've tried using the following as
the rowsource for the listbox, but in form view nothing is displayed. Does
anyone know how to do this?

TIA,

Ken Warthen
[email protected]

"SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((Left([Name],1))<"~") AND ((MSysObjects.Type)=-32764))
ORDER BY MSysObjects.Name;"
 
D

Douglas J. Steele

I think you made a slight typo. Try (((Left([Name],1))<>"~") rather than
(((Left([Name],1))<"~")

That's <> instead of <
 
K

Ken Warthen

dDoug,

Thanks for your help. I actually figured it out by trial and error getting
the results I wanted with:

SELECT MSysObjects.Name FROM MSysObjects
WHERE ((MSysObjects.Type)=-32764)
ORDER BY MSysObjects.Name;

It would be nice to know a source for system object types. Remembering
numeric expressions like -32764 for reports is tough on the brain.

Thanks again,
Ken

Douglas J. Steele said:
I think you made a slight typo. Try (((Left([Name],1))<>"~") rather than
(((Left([Name],1))<"~")

That's <> instead of <

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ken Warthen said:
I recently upgraded to Access 2007 and am having some trouble with the
changes. I have a form with a listbox in which I would like to display
the
names of all the reports in the database. I've tried using the following
as
the rowsource for the listbox, but in form view nothing is displayed.
Does
anyone know how to do this?

TIA,

Ken Warthen
[email protected]

"SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((Left([Name],1))<"~") AND ((MSysObjects.Type)=-32764))
ORDER BY MSysObjects.Name;"
 
D

Douglas J. Steele

It would be nice, but it's officially undocumented. You have no choice but
to figure it out on your own. Fortunately, there aren't that many type
values, so it's not that difficult.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Ken Warthen said:
dDoug,

Thanks for your help. I actually figured it out by trial and error
getting
the results I wanted with:

SELECT MSysObjects.Name FROM MSysObjects
WHERE ((MSysObjects.Type)=-32764)
ORDER BY MSysObjects.Name;

It would be nice to know a source for system object types. Remembering
numeric expressions like -32764 for reports is tough on the brain.

Thanks again,
Ken

Douglas J. Steele said:
I think you made a slight typo. Try (((Left([Name],1))<>"~") rather than
(((Left([Name],1))<"~")

That's <> instead of <

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ken Warthen said:
I recently upgraded to Access 2007 and am having some trouble with the
changes. I have a form with a listbox in which I would like to display
the
names of all the reports in the database. I've tried using the
following
as
the rowsource for the listbox, but in form view nothing is displayed.
Does
anyone know how to do this?

TIA,

Ken Warthen
[email protected]

"SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((Left([Name],1))<"~") AND ((MSysObjects.Type)=-32764))
ORDER BY MSysObjects.Name;"
 
Top