Re: NoCurrent record error when calling ReQuery on a subform
- From: "Anja" <anja.ende@xxxxxxxxxxxxxx>
- Date: 24 Oct 2006 07:05:16 -0700
kingston via AccessMonster.com wrote:
I don't think that this conditional is working the way you want it to:
"If Not rs.EOF Or Not rs.BOF Then"
Is this where the error occurs? Also, when you set rs, are you sure that
there is a recordset at the Me level? Is the subform where the recordset
resides?
Anja wrote:
Hi everyone,
I am running Access and am using VBA to make a custom app.
I have a tab control and one of the pages has a subform. I query the
currently selected record in the subform by overriding the 'On Current'
event as follows:
Private Sub Form_Current()
Dim rs As Recordset
Set rs = Me.Recordset
If Not rs.EOF Or Not rs.BOF Then
MsgBox rs![FormalName]
End If
End Sub
This works fine. Now, I wanted to requery the subform everytime the tab
control changs pages as the underlying records might have changed.
So, I did the following:
Private Sub TabCtl6_Change()
Me.SuppliersWithUnknownCategories_V_subform.Form.Requery
End Sub
However, this always ends up in the previous method with the error "No
current record.".
I tried Refresh, Recalc and other methods but they do not seem to
refresh the data.
Any ideas how I can query the subform data again properly?
Any help is greatly appreciated.
Thanks,
Anja
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200610/1
Hi,
Thanks for the reply. The recordset is definitely there. It works fine
normally... only when I call ReQuery after the tab change event
happens, that is fails.
The error happens on the line:
MsgBox rs![FormalName]
Thanks,
Anja
.
- Follow-Ups:
- Re: NoCurrent record error when calling ReQuery on a subform
- From: kingston via AccessMonster.com
- Re: NoCurrent record error when calling ReQuery on a subform
- References:
- NoCurrent record error when calling ReQuery on a subform
- From: Anja
- Re: NoCurrent record error when calling ReQuery on a subform
- From: kingston via AccessMonster.com
- NoCurrent record error when calling ReQuery on a subform
- Prev by Date: Re: NoCurrent record error when calling ReQuery on a subform
- Next by Date: Re: NoCurrent record error when calling ReQuery on a subform
- Previous by thread: Re: NoCurrent record error when calling ReQuery on a subform
- Next by thread: Re: NoCurrent record error when calling ReQuery on a subform
- Index(es):
Relevant Pages
|