Connecting Tech Pros Worldwide Help | Site Map

subform's recordset problems

mark_aok
Guest
 
Posts: n/a
#1: Jul 12 '07
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

mark_aok
Guest
 
Posts: n/a
#2: Jul 12 '07

re: subform's recordset problems


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:
Quote:
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

Closed Thread