That's right. When you first enter new record, eg after the ON CURRENT
method has fired and the new record, along with the attached child records
are displayed in the subform, no record is actually selected, even though
the first one will have the selection arrow lit up next to it.
When you try to access the 'highlited' record in the subform, for example:
lngID = Me.MySubForm.Form.recordset!RecordID
You get the "No Current Record" error.
Thanks
Mike Thomas
> Hi Mike
>
[quoted text clipped - 57 lines]
>> >> Many thanks
>> >> Mike Thomas
David Cleave - 08 Aug 2005 09:23 GMT
I might know what this is. Are you saying the OnCurrent event on the parent
form is referring to a record in the subform?
This is a serious problem with Access imho. The parent form's OnCurrent
event will trigger before the subform has loaded its own records. Thus if the
parent form's OnCurrent event refers to records in the subform (which haven't
loaded yet), an error occurs.
Is that what is happening in your database? Does the OnCurrent event in the
parent form refer to child form records?
David
> That's right. When you first enter new record, eg after the ON CURRENT
> method has fired and the new record, along with the attached child records
[quoted text clipped - 71 lines]
> >> >> Many thanks
> >> >> Mike Thomas
Biguana - 09 Aug 2005 11:37 GMT
Mike,
I've got a very similar problem (although I appreciate that's not very
helpful for you).
My buttons are actually on the detail of the continuous form in the
subform, so when you click one, that record must be (a) loaded and (b)
selected, by definition, but "No Current Record".
Like you BOF and EOF are both false and the Recordcount returns a
positive integer value. The annoying thing is that it seems very
intermittent and I can't pin down the conditions exactly (although it
does seem more frequent when there are less records (or just one
record) in the subform recordset).
Again like you I'd rather avoid having to handle the error because I
see no reason for it, and that wouldn't solve the problem because I'd
still need to get that record ID...
Seems like a bug. Any ideas anyone?
Tim