469,592 Members | 1,795 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

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.form.currentRecord, it shows a perfectly valid
currentRecord value. But when I look at the actual recordset
(me.mySubForm.recordset), 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

Jul 12 '07 #1
1 3994
I ended up fixing this with the following code,

Dim correctRecord as string
correctRecord = Me.mySubForm.Form.currentRecord
Me.mySubForm.Form.Recordset.MoveFirst
Me.mySubForm.Form.Recordset.Move (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_...@hotmail.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.form.currentRecord, it shows a perfectly valid
currentRecord value. But when I look at the actual recordset
(me.mySubForm.recordset), 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

Jul 12 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

18 posts views Thread by Robert Jacobs | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.