tool tip text in dbgrid

Posted on 2000-05-15
Last Modified: 2008-02-01
well i have a db grid with 2 columns and i want that hen the user moves the mouse over the dbgrid the tool tip text should change according to the text in the cell

eg when the mouse is on name

xyx the tool tip text should show xyz
and if on vnv
then it chould change accordingly

thanx a lot
Question by:sonalchouhan
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 43

Accepted Solution

TimCottee earned 10 total points
ID: 2810083
Add this to your form code containing the dbgrid. It changes the tooltip text to reflect the contents of the cell over which the mouse is positioned.

Private Sub DBGrid1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    On Error Resume Next
    With DBGrid1
        .ToolTipText = .Columns(.ColContaining(X)).CellValue(.RowBookmark(.RowContaining(Y)))
    End With
End Sub

Author Comment

ID: 2810388


Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month9 days, 11 hours left to enroll

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question