Cursor location on DAO...

MackMan

Registered User.
Local time
Today, 09:14
Joined
Nov 25, 2014
Messages
174
Hi all. I'm using the following on a Click event to load a real time tooltip showing details where there is more than one entry on a related table...

Code:
Dim strSQL As String
Dim dbsmyaccounts As DAO.Database
Dim rstSplits As DAO.Recordset
  
If Me.Part <> "Split : Multiple Parts" Then
    Exit Sub
Else
    strSQL = "Select * from qryMouseoverPARTS Where EntryID = " & Me.EntryID
    
     Set dbsmyaccounts = CurrentDb
    Set rstSplits = dbsmyaccounts.OpenRecordset(strSQL, dbOpenDynaset)
   
 With rstSplits
    If .RecordCount > 0 Then
        strSQL = ""
          Do While .EOF = False
           strSQL = strSQL & !PartNo & " : " & !PartDescription & "    " & Format(!Amount, "Currency") & vbCrLf
            .MoveNext
            Loop
End If
End With

 Me.Part.ControlTipText = strSQL

 Set rstSplits = Nothing
Set dbsmyaccounts = Nothing
End If
On the whole it's displaying the correct information (formatting aside) however...

I'd like to open the DAO on a mouseover AND find the location of the cursor in relation to the record it's over on a continuous subform.

Is it possible to find the cursor location in the currentdb?

As always many thanks and appreciate your advise.
 
As to nomenclature, "cursor" in its literal database sense makes no sense as a reporting item. Cursors as place markers are OK, but they are internal values not usually fit for human consumption.

You could, however, examine the fields of a recordset to get its current PK or some other identifying information, particularly if (a) you know the correct name of the recordset and (b) you know the name of the key. At that point, you might be able to pick up something no more complex than (using your recordset name....)

Code:
    CursorVal = rstSplits![PK]

(which only works if the recordset is open).
 

Users who are viewing this thread

Back
Top Bottom