• BOF EOF (2000)

    Author
    Topic
    #403259

    Paul: BOF is true when the current position is before the first record in the recordset, not at the first record. HTH.

    Viewing 3 reply threads
    Author
    Replies
    • #809668

      Hi, I have had a search thorugh previous posts but cant seem to find a solution to my ignorance!

      I am trying to disable / enable my custom command button record selectors depending on whether my form is displaying the 1st or last record. I thought that the following would return true if i was at the first record.

      debug.print me.recordsetclone.BOF

      but it doesnt.

      I have a form whose record source is a query, and have used the wizard to create next / prev record selectors. Why doesnt the BOF return true when i open the form or go to the first record?

      thanks

    • #809669

      Hi, I have had a search thorugh previous posts but cant seem to find a solution to my ignorance!

      I am trying to disable / enable my custom command button record selectors depending on whether my form is displaying the 1st or last record. I thought that the following would return true if i was at the first record.

      debug.print me.recordsetclone.BOF

      but it doesnt.

      I have a form whose record source is a query, and have used the wizard to create next / prev record selectors. Why doesnt the BOF return true when i open the form or go to the first record?

      thanks

    • #809686

      Thanks, I see.

      After a bit of thought and trial and error…I used this code which works fine bingo !!

      Sub cmdRecordSelectors()
      With Me.Recordset
      Select Case .AbsolutePosition
      Case 0
      Me.cmdPrev.Enabled = False
      Me.cmdNext.Enabled = True
      Case .RecordCount – 1
      Me.cmdNext.Enabled = False
      Me.cmdPrev.Enabled = True
      Case Else
      Me.cmdPrev.Enabled = True
      Me.cmdNext.Enabled = True
      End Select
      End With
      End Sub

    • #809687

      Thanks, I see.

      After a bit of thought and trial and error…I used this code which works fine bingo !!

      Sub cmdRecordSelectors()
      With Me.Recordset
      Select Case .AbsolutePosition
      Case 0
      Me.cmdPrev.Enabled = False
      Me.cmdNext.Enabled = True
      Case .RecordCount – 1
      Me.cmdNext.Enabled = False
      Me.cmdPrev.Enabled = True
      Case Else
      Me.cmdPrev.Enabled = True
      Me.cmdNext.Enabled = True
      End Select
      End With
      End Sub

    Viewing 3 reply threads
    Reply To: BOF EOF (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: