xavier.batlle
Active member
- Local time
- Today, 02:48
- Joined
- Sep 1, 2023
- Messages
- 120
Sometimes it can be interesting to print the recordset bookmark values assigned by Access. This simple function transforms the Variant value in an Hex value that can be printed.
Output example: 00-2A-25-03
Maybe someone will find it useful.
Output example: 00-2A-25-03
Code:
Public Function BookmarkToHex(bookmarkValue As Variant)
BookmarkToHex = Right("0" & Hex(AscB(VBA.MIDB(bookmarkValue, 4, 1))), 2) & "-" & _
Right("0" & Hex(AscB(VBA.MIDB(bookmarkValue, 3, 1))), 2) & "-" & _
Right("0" & Hex(AscB(VBA.MIDB(bookmarkValue, 2, 1))), 2) & "-" & _
Right("0" & Hex(AscB(VBA.MIDB(bookmarkValue, 1, 1))), 2)
End Function
Maybe someone will find it useful.
Last edited: