Another ToolTip question with ListBox

E

Edward P Sager

Hello,

I noticed that when I use Mr. Leban's ToolTips solution with ListBoxes, it
has as each row's ToolTip all data from each column in the appropriate row.
I want for only one column's data to be the ToolTip.

Where in the code do I need to go in order to change which columns I desire
for the ToolTip?

Thank you,
edsager
 
S

Stephen Lebans

Open the clsListBox code module.
The very last line of the class module reads:

' Update the ToolTip text
m_ToolTip.SetToolText m_ListBox, sTemp

Just comment out this line.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
E

Edward P Sager

Mr. Lebans:

Thank you for your response; however, when I comment out the line you
mention below, it eliminates the multi-field ToolTip response, but I am
unable to get only a single field from the underlying table to be the
ToolTip.

Is there a way to do this?

Thank you,
edsager
 
S

Stephen Lebans

As per the code behind the sample forms, in the Form's Load event, you
set the ToolTip text to the desired value.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
E

Edward P Sager

Mr. Lebans:

First, thank you for your responses. If I am taking up too much of your
time by asking these questions, please let me know.

What I am trying to do is have distinct ToolTips appear for every item in my
ListBox, but have the distinct ToolTip be data
from only one (1) of the underlying fields in the table, which fields are
displayed in the ListBox. It seems as though the code for the ToolTips, as
it stands now, either displays all the underlying fields or none of the
underlying fields. I have a ToolTip defined for the entire ListBox itself,
but it is a general one for the entire ListBox, not distinct to each row of
text in the ListBox.
For example,

The table contains fields which include (1) a number associated with cases
decided by the US Federal courts, (2) the name of the case, and (3) a
description. Each number, name and description are unique. The ListBox
displays only the number associated with the case and the name of the case.
I would like the ToolTip to display the description associated with each
case, which descriptions are unique to each case.

Right now, the ToolTip either gives all 3 fields (#, name, description) for
each row in my ListBox, or only the general statement (if I turn off the
unique line-by-line-in-ListBox-ToolTip): "To select multiple cases, use
either Shift or Ctrl."

I have studied your code thoroughly and I cannot figure out how to limit the
ToolTips to the "Description" Field in the underlying table. I suppose I
could try and define a ToolTip for each case, but I wonder of there is a
better way.

Anyway, thank you again for your time.

edsager
 
S

Stephen Lebans

If you look at the 3 lines of code immediately above the line I had you
comment out you will see where the Tooltip string is built from all of
the Columns of data of the ListBox for the specific row the Mouse is
currently hovering over. Just create the ToolTip string from whatever
Column(s) you want.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

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