Connecting Tech Pros Worldwide Help | Site Map

subform's recordset problems

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 12th, 2007, 05:35 PM
mark_aok
Guest
 
Posts: n/a
Default 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


  #2  
Old July 12th, 2007, 05:55 PM
mark_aok
Guest
 
Posts: n/a
Default 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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.