I have problem with check the last element in list in ms access and put the last value to label. I have used a loop to realize this:
Private Sub lstAbgänge_DblClick(Cancel As Integer)
i = 0
r = 0
Do Until Me.lstAbgänge.Column(0, i) = Null
i = i + 1
r = Me.lstAbgänge.Column(0, i)
If r = Null Then Exit Do
Loop
'Me.lblVorgangNr.Caption = Me.lstAbgänge.Column(0, i - 1)
End Sub
My problem is that loop is neverending, I have tried end this loop by condition "Me.lstAbgänge.Column(0, i) = Null" and next by "If r = Null Then Exit Do" but in both cases it doesn't work. When it has value Null loop is still working.