I need help with a list box

A

Al

I have a table called "tblSheets" that contains sheet numbers as follows:
A-001
A-002
B-001
For each sheet there can be comments made in a table called "tblComments".

I have a form which has a list box that shows all sheets from tblSheets
regardless to whether they have comments existing in the tblComments or not.
I need to show the user which items on the list box that have comments
entered in the tblComments without having the user to click on each item in
the list box to find out if there were comments entered or not. Is there a
way to bold or color items in the list box if they have comments? or any
other way? there can be hundreds of sheets on the list.
thanks
Al
 
A

Allen Browne

You cannot color or bold items selectively in a list box.

However, you could add an extra column to the RowSource of the list box to
indicate if there are any comments.

This example assumes that tblComments is joined to tblSheets on the SheetID
field:

SELECT tblSheets.SheetID,
IIf(EXISTS (SELECT CommentID FROM tblComments
WHERE tblComments.SheetID = tblSheets.SheetID),
"X", Null) AS HasComment
FROM tblSheets;

If subqueries are new, see:
http://allenbrowne.com/subquery-01.html
 

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