Displaying a list of reports on a form

G

Guest

I currently have 2 comand buttons on my form which print different reports.
I'd like to now have them in a listbox instead.

Fredg has answered someone elses question by telling them to do this

As Rowsource of a list box or combo box:

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

Code the Combo or List box AfterUpdate event:
DoCmd.OpenReport Me!ComboName, acViewPreview

The problem is that after inserting the rowsource bits into the sql window I
press run and get the message "Undefined function 'Left' in expression".

I'm using access 2000. Does anyone know what I've done wrong?

Thanks.
 
G

Guest

I think I have solved the reference problem in that I unchecked the box that
was missing but then couldn't find the exact reference again in the list.

When I now run the query I don't get an error message but nothing actually
appears, it just says Name as the column heading and the column itself is
empty.
 
J

John Vinson

The problem is that after inserting the rowsource bits into the sql window I
press run and get the message "Undefined function 'Left' in expression".

This appears to be the very common References bug. Open any
module in design view, or open the VBA editor by typing
Ctrl-G. Select Tools... References from the menu. One of the
..DLL files required by Access will probably be marked
MISSING. Uncheck it, recheck it, close and open Access.

If none are MISSING, check any reference; close and open
Access; then uncheck it again. This will force Access to
relink the libraries.


John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

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

Top