Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Memory Loss - Mine! (A2K)

    I hate it when this happens. Yesterday I found a neat enhancement to the following code:



    Private Sub Form_Current()
    If Me.NewRecord Then
    Me!lblRecCount.Caption = "New"
    Else
    Me.RecordsetClone.Bookmark = Me.Bookmark
    Me!lblRecCount.Caption = "RA # " & CStr(Me.RecordsetClone.AbsolutePosition + 1) _
    & " of " & CStr(Me.RecordsetClone.RecordCount)
    End If
    End Sub


    That would, when the form is first opened, ensure that the full record count showed:

    1 of 375

    and not

    1 of 1

    It had to do with going to the last record, or something,

    Aaarggghhh! I can
    Cheers,
    Andy

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Memory Loss - Mine! (A2K)

    Why don't you use Me.CurrentRecord instead of CStr(Me.RecordsetClone.AbsolutePosition + 1)? You wouldn't need the line

    Me.RecordsetClone.Bookmark = Me.Bookmark

    Try

    ...
    Else
    Me.RecordsetClone.MoveLast
    Me!lblRecCount.Caption = "RA # " & Me.CurrentRecord _
    & " of " & CStr(Me.RecordsetClone.RecordCount)
    End If

    <img src=/S/whisper.gif border=0 alt=whisper width=29 height=17> Allow me to once more draw your attention to the nifty built-in feature named Navigation Buttons? No code needed at all!

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Memory Loss - Mine! (A2K)

    Hans,

    Thanks kindly. I would have taken my memory enhancement pills this morning, but I forgot where I left them.

    Cute reminder! However, and I can understand why you wouldn't remember this, but I am working for what I like to refer to as the "Near-sighted Mouseless Wonders". Don't ask, it's their nickle. Or Euro. Or Centavo. Or whatever...
    Cheers,
    Andy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •