I have the following code that is trying to fill the values of the recordset into labels that should appear under eachother neatly. And then I want the label to be underlined (like hyperlinks) with a pointer cursor when a mouse comes over it. And upon clicking on it, I want it to perform an action.
However, I failed to Dim WithEvents for unknown reason!
Please correct my code, or recommend otherwise!
If Not (RS.BOF And RS.EOF) Then
Dim LBL() As Label
For i = 1 To RS.RecordCount
ReDim Preserve LBL(i)
.Caption = RS("FormCaption")
.Left = 0
.Top = LBL(i - 1).Top + LBL(i - 1).Height
.Visible = True
Private Sub LBL_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.LBL(Index).FontUnderline = True
Screen.MouseIcon = vbArrow