Re: .BOF and .EOF are lying!



See below

"david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
news:ufE6TO3oFHA.3256@xxxxxxxxxxxxxxxxxxxxxxx
>> you can't trust .recordcount until you've done a .movelast.
>
> No, but I've always had > 0
>
>> Before moving to the last record, sometimes the record count is 0.

Well, you may be on to something. I went back to a form where I thought I
was getting 0 instead of the full count, but it turns out it was 1. So I'll
give .RecordCount = 0 a try.

>
> Ok, I've never seen that.
>
>> I'm not using a record clone.
>
> What /ARE/ you doing?


For forms
Me.Recordset.RecordCount
or Me.Recordset.Bof, .EOF

or, sometimes
Dim lrst_Me As Recordset
Set lrst_Me = Me.Recordset

Very often I'm dealing with a recordset created this way:
Set irst_ClassPeriods = CurrentDb.OpenRecordset(ls_sql)



>
>>>> retrieval arguments? If I retrieve the data in the form and rows, and
>>>> then I change the values that are used as arguments
>
> What are you testing for BOF and EOF? Forms don't have a BOF
> or EOF parameter. Please show your code.

Me.Recordset.EOF

>
> (david)
>
>
>
> "Laurel" <FakeMail@xxxxxxxxxxx> wrote in message
> news:OA88ms1oFHA.3036@xxxxxxxxxxxxxxxxxxxxxxx
>>I got into testing .bof and .eof because I learned that you can't trust
>>.recordcount until you've done a .movelast. (And I have confirmed this
>>myself.... several times... Before moving to the last record, sometimes
>>the record count is 0. Sometimes it is the unfiltered count, etc.)
>>Anyway, testing for .eof and .bof was a way of avoiding an error when
>>.movelast was attempted on an empty recordset.
>>
>> So here we are coming around the circle again....
>>
>>
>> "david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message
>> news:uFNp6bvoFHA.2580@xxxxxxxxxxxxxxxxxxxxxxx
>>> Use .recordcount > 0 to check if the recordset is empty.
>>> Then use move or find if you want to position at a record.
>>>
>>> Remember that by definition .RecordsetClone is a recordset
>>> with different record pointers than those used by the form.
>>>
>>> Ignore whatever the help files say about .bof and .eof
>>> for recordset clones: The help was never correct.
>>>
>>> (david)
>>>
>>> "Laurel" <FakeMail@xxxxxxxxxxx> wrote in message
>>> news:OISvtztoFHA.2580@xxxxxxxxxxxxxxxxxxxxxxx
>>>> Are there steps one should take before requerying a form with different
>>>> retrieval arguments? If I reetrieve the data in the form and there are
>>>> rows, and then I change the values that are used as arguments to
>>>> something that would return no rows .EOF and .BOF are both false.
>>>>
>>>> If the arguemtns that would return no rows are used first, .bof and
>>>> .eof are true as one would expect.
>>>>
>>>> Any suggestions?
>>>>
>>>
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: .BOF and .EOF are lying!
    ... > you can't trust .recordcount until you've done a .movelast. ... > Before moving to the last record, sometimes the record count is 0. ... What are you testing for BOF and EOF? ...
    (microsoft.public.access.gettingstarted)
  • Re: Toolbar
    ... > record of the table other than go top and go bottom. ... > bof() or eof(), etc. ... only needs to be done during a navigation operation, moving ...
    (microsoft.public.fox.programmer.exchange)
  • Re: .BOF and .EOF are lying!
    ... >>> you can't trust .recordcount until you've done a .movelast. ... >>> Before moving to the last record, sometimes the record count is 0. ... >> What are you testing for BOF and EOF? ... Forms don't have a BOF ...
    (microsoft.public.access.gettingstarted)
  • Re: .BOF and .EOF are lying!
    ... You haven't shown us the specific circumstance when the BOF and EOF ... those for forms' recordset or recordsetclone. ... correct count for me without having to use .MoveLast. ...
    (microsoft.public.access.gettingstarted)
  • Re: Check number of subform records
    ... if .bof and .eof ...
    (microsoft.public.access.formscoding)

Loading