I placed a long button on a form that on the mouse over event basically changes the caption of the button to read a record number based on the percentage the mouse is moved from left to right. Then on the OnClick event I move to that record. I would like to add one more line of code that looks up that records date and assigns it to a tool tip or some other indicator for the user.
Since the reference on what record to look at is simply a record number I have to use that record number in my Dlookup, I am having problems figuring out the 3rd part of the Dlookup. Thanks!
Private Sub Command41_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim Place As Long
Dim intX As Long
intX = DCount("*", "qryTblHistory")
Place = Round(intX)
Dim strChr As String
strChr = Round((X / Me.Command41.Width * Place))
If Me.Command41.Caption <> strChr Then
Me.Command41.Caption = strChr
Me.Command41.ControlTipText = DLookup("[date]", "qryTblHistory", Me.??????RecordNumber???? = strChr)
End If
End Sub
Since the reference on what record to look at is simply a record number I have to use that record number in my Dlookup, I am having problems figuring out the 3rd part of the Dlookup. Thanks!
Private Sub Command41_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim Place As Long
Dim intX As Long
intX = DCount("*", "qryTblHistory")
Place = Round(intX)
Dim strChr As String
strChr = Round((X / Me.Command41.Width * Place))
If Me.Command41.Caption <> strChr Then
Me.Command41.Caption = strChr
Me.Command41.ControlTipText = DLookup("[date]", "qryTblHistory", Me.??????RecordNumber???? = strChr)
End If
End Sub