473,385 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to show listbox content using "on mouse over event" vba

Hi All,

Thank you in advance for your valuable help. I'm working on a project in which I have a form with 3 listbox each one of them has long string content. So I would like to be able to allow the user to see the content using "On mouse over event" with vba. Any help will be greatly appreciated.

Thanks!

Joe
Mar 3 '11 #1

✓ answered by ADezii

You can sort of mimic this behavior by:
  1. Single Clicking an Items in the List Box, thereby Selecting that Item.
  2. Keeping the Mouse Pointer positioned over the Selected Item.
  3. Setting the ControlTipText Property to the Item Selected.
  4. This can actually be done in the AfterUpdate() Event of the List Box.
    Expand|Select|Wrap|Line Numbers
    1. Private Sub lstDemo_AfterUpdate()
    2.   Me![lstDemo].ControlTipText = Me![lstDemo].Column(1)
    3. End Sub

9 15864
patjones
931 Expert 512MB
Hi Joe,

What do you mean by "see the content"?

In any case, Access does not have a mouse-over event. This was something I looked into when I first started designing forms in Access. It's not to say that it isn't possible to custom code something in VBA to accomplish this, but I suspect that it would require some system API programming and such.

The closest built-in functionality is the "screen tip" that you can set to pop up when mousing over a control.

Pat
Mar 3 '11 #2
Hi Pat,

Thanks so much for the quick response. Sorry if I didn't make myself clear. I kind of new with vba.

I have a listbox with long string content items. I would like the user to see the complete item string line when they pointed with the mouse. Is there any way to do this? Thanks again!

Joe
Mar 3 '11 #3
ADezii
8,834 Expert 8TB
You can sort of mimic this behavior by:
  1. Single Clicking an Items in the List Box, thereby Selecting that Item.
  2. Keeping the Mouse Pointer positioned over the Selected Item.
  3. Setting the ControlTipText Property to the Item Selected.
  4. This can actually be done in the AfterUpdate() Event of the List Box.
    Expand|Select|Wrap|Line Numbers
    1. Private Sub lstDemo_AfterUpdate()
    2.   Me![lstDemo].ControlTipText = Me![lstDemo].Column(1)
    3. End Sub
Mar 4 '11 #4
Hi ADezii,

You are great! That works very well for what I needed. Thanks so much for your help.

Joe
Mar 4 '11 #5
ADezii
8,834 Expert 8TB
You are quite welcome, Joe. Glad it worked out for you.
Mar 4 '11 #6
ary1
2
But how to wrap text of toolrip if the string is too long , id any method for it
Nov 30 '12 #7
NeoPa
32,556 Expert Mod 16PB
Normally we don't allow follow-on questions from other members, but as this one is so closely attuned to the original I'll let it slide, and even answer.

The answer's simple enough. This approach uses the built-in TooltipText property of the control. As such, there is no control over how the data is displayed unless you would like to doctor the data before inserting it into the property. Less straightforward, and highly dependent on your data. Even worse, I can't even say for sure that it would work :-D

PS. I tested it and it works fine, but you'd still need to determine where to insert your vbNewLine characters ;-)
Nov 30 '12 #8
ary1
2
Thanx
But can you give an example, I am trying to display controltiptext by giving refrance like after selecting tabindex of selected row of listbox and displaying where rowsouce -sheet!a1:b4 but if I put long string is displaying more than screen
Nov 30 '12 #9
NeoPa
32,556 Expert Mod 16PB
Not here I'm afraid. Your last post missed being a hijack by the width of a gnat's hair. Please post your question in it's own thread if you'd like further help with this.
Nov 30 '12 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

20
by: DraguVaso | last post by:
Hi, As a former VB-programmer I'm used to the "on error goto"-errorhandling. I see that in actually all the VB.NET-samples I can fin people use the "Try - catch"-errorhandling. Which of the...
3
by: Ahmed Ayoub | last post by:
i forgot how to create Textboxes & Label Dynamically. Meaning, i want to make them .. initialize their position .. and view them and interact with them.
8
by: Nick | last post by:
I have a table with columns (product_id,related_product_id,related_counter) If product A is related to product B then a record should be created, if the record already exists then the...
1
by: S. van Beek | last post by:
Dear reader, First of all a happy new year. In Report event there is the "On No Date" event but in a Form this event is not available.
2
by: Ron M. Newman | last post by:
Hi, My class has an event to which other classes subscribe (e.g. myevent+= foreignDelagate). I'd like to find out how many subscribers "myEvent" has. Up till now I tested it for "null" or...
6
by: OAM | last post by:
Hi Is it possible to add and remove tabs "on the fly" ? Anybody have a (ajax...) script to do this ? Thanks Olivier.
6
by: MarkoBBC | last post by:
Hi everyone, First a brief description of my form: I have a subform within a main form. In my subform, I have a listbox displaying address information by firm name. A user first has to select a...
7
by: Michael R | last post by:
It's an interesting question, as I see it. I have a form, in which there are a few command buttons, which change color when the mouse is on top of them (On Mouse Move). Now, I want the color to be...
10
by: JHNielson | last post by:
I am designing an interface, and I would like to customize the buttons instead of using the plain gray boxes that are standard in Access. Is there a way to set for the "On Mouse Up" and "On...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.