Update control tip text with message whenever combobox entries are selected

novice

Registered User.
Local time
Today, 14:26
Joined
Jun 3, 2009
Messages
32
Hi,

I have a form with a combobox which contains list of school codes stored in a table. The table contains school code and school name.

Whenever a school code is selected in the combobox, I would like to display the School Name in control tip text. But i couldnot able to figure out when can i update the control tip text.

I would like to get the value of selected entry of combobox whenever i hover on combobox list so that the control tip text gets updated automatically. The following is the code which i have written.

SCH_CODE.ControlTipText = DLookup("[SCHOOL_NAME]", "[SCHOOL]", _
"[SCH_CODE] = '" & Me.SCH_CODE & "'")

Can any one guide me on how to do this. Thanks.
 
So long as the value you wish to use in your Tool tips is being selected by the query that is populating your Combo you could put the following in the Combo's On Change event;

Code:
Me.ComboName.ControlTipText = Me.ComboName.Column([B]x[/B])

Where x is the column number of the column that holds the info you want in the tool tip. Remember that the first column in the Combo is numbered zero not one, and count from there. You don't necessarily have to have this info visible in the combo.
 
Thanks for your reply. I'm not clear with the statement
Me.ComboName.ControlTipText = Me.ComboName.Column(x).

ControlTipText should be set with a value looked up from the table. But instead it above statement is doing differently.

Can you tell me on how to get the column number 'x' when hovered on combobox list. (btw m assuming that the column number is the index of the elements in the combobox list).
 
Have a look at the attached DB. I've used two combo boxes, one derives it's Control Tips from a hidden column in it's Row Source. The other derives it's Control Tips using a Dlookup, something like;

Code:
Me.Combo4.ControlTipText = DLookup("[Sname]", "TBL_Names", "ID=combo4.value")
 

Attachments

Thanks for posting the code. This is what i'm looking for. Also, another thing which i was mentioning is that when mouse is hovered on the list it should show the control tip text some thing like "Fname Sname".
I'm not sure whether this can be done in Access or not.
 
Unless I've misunderstood the code we have been talking about and that I have used in sample DB, shows the control tip when the mouse hovers over the control. It does take a little while to appear though.
 
Thanks for your reply. Control Tip Text is shown after selecting an entry into ComboBox. This is what is done in code also. But what i'm looking for is After drop down list is populated and mouse is hovered on the LIST, Control Tip Text should be shown dynamically, if i'm not expecting too much from MS Access.
Do you know which routine is called when mouse is hovered in the list, if that is know it can be done.
 
If I've understood you, what you want is for the control tip to change as you move the mouse down the list, over the various available selections?
 
Yes exactly. I want the control Tip Text to change as i select the list and move the mouse up/down the list.
 
Yes exactly. I want the control Tip Text to change as i select the list.................
This part you should already be able to do, given the code and example already provided.


I want the control Tip Text to change as i ..........move the mouse up/down the list.
This bit is going to be a whole lot trickier, if it can be done at all. For it to work you will first need some code to determine if the list has been dropped down our not, next you need to determine what options are visible and what position they hold in the list, then you need to determine the position of the mouse pointer with relation to the visible list, then you need to determine the correct tool tip and finally feed that back to tool tips valuye. If all this is even possible it's going to be quite a complex piece of code.
 
If all this is even possible it's going to be quite a complex piece of code.
I do not think this is possible because of the fact that the list will not have a value based on its mouse location. The "value" of the combo is the selected item and the list will not return a value regardless until it has been selected.
 

Users who are viewing this thread

Back
Top Bottom