subform's recordset problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mark_aok

    #1

    subform's recordset problems

    Hi all,

    I have a form with a subform called "mySubForm" (the subform is always
    in datasheet view), and I have a button labeled "return item". When
    users click return item, it finds the record from the datasheet, and
    it modifies some fields.

    The problem is, I am randomly getting an error saying "no current
    record". When I check
    me.mySubForm.fo rm.currentRecor d, it shows a perfectly valid
    currentRecord value. But when I look at the actual recordset
    (me.mySubForm.r ecordset), it says that there is no currentRecord.

    Anyone have any idea what's going on?

    P.S I haven't been able to determine why this occurs randomly.
    Everyone once in a while, it just looses the currentRecord.

    Thanks

  • mark_aok

    #2
    Re: subform's recordset problems

    I ended up fixing this with the following code,

    Dim correctRecord as string
    correctRecord = Me.mySubForm.Fo rm.currentRecor d
    Me.mySubForm.Fo rm.Recordset.Mo veFirst
    Me.mySubForm.Fo rm.Recordset.Mo ve (correctRecord - 1)

    It worked, but the fact that Access seems to forget the currentRecord
    is still a mystery to me.

    Mark

    On Jul 12, 1:29 pm, mark_aok <mark_...@hotma il.comwrote:
    Hi all,
    >
    I have a form with a subform called "mySubForm" (the subform is always
    in datasheet view), and I have a button labeled "return item". When
    users click return item, it finds the record from the datasheet, and
    it modifies some fields.
    >
    The problem is, I am randomly getting an error saying "no current
    record". When I check
    me.mySubForm.fo rm.currentRecor d, it shows a perfectly valid
    currentRecord value. But when I look at the actual recordset
    (me.mySubForm.r ecordset), it says that there is no currentRecord.
    >
    Anyone have any idea what's going on?
    >
    P.S I haven't been able to determine why this occurs randomly.
    Everyone once in a while, it just looses the currentRecord.
    >
    Thanks

    Comment

    Working...