Re: Using Recordset.State Property



In this situation, you do not have multiple instances, there is only one
instance. If you Set and Open it in two different procedures, and then
attempt to access it in a third procedure, what you get will depend on which
of the two Set and Open procedures was called most recently.

If the recordset is being used for two or more distinct purposes, returning
two or more distinct subsets of data, it would probably be better to have a
separate recordset for each subset of data.

--
Brendan Reynolds (MVP)

"Ilya" <Ilya@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:3639ADC7-7BBA-4374-A3D1-7874A8FCED46@xxxxxxxxxxxxxxxx
> Thanks for advice to check multiples. I do not have another declaration,
> but
> I may have multiple execution of procedure where Recordset is Set and
> Open.
> So, I may have several instances of recordset. How Microsoft distinguish
> them
> or it keeps only one, closing previous one? Does multiple Set and Open
> have
> anything to do with my problem? Thanks in Advance.
> --
> Ilya
>
>
> "Van T. Dinh" wrote:
>
>> So is it in a Standard Module?
>>
>> Worked fine for me when I declared the rs as Public in a Standard Module
>> and
>> checked the State in another Module (Form / Class Module).
>>
>> Check the Module where you accessing the State. You might have another
>> DfltRs declared in this Module (Module-level scope) which will take
>> precedence over the Public Var. The same thing happens if you declare a
>> Procedure-level-scope variable of the same name.
>>
>> --
>> HTH
>> Van T. Dinh
>> MVP (Access)
>>
>>
>>
>> "Ilya" <Ilya@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:B0C317C0-D70D-46D2-9365-8F6FFA148745@xxxxxxxxxxxxxxxx
>> >I have executed Set statement before checking .State of Recordset. I
>> >have
>> >not
>> > created class module for declare the recordset: thinking the Recordset
>> > is
>> > the
>> > object by itself (i. e. by Microsoft) and if I delcare it as a Public
>> > one,
>> > then it would be accessible across the Project. What is the problem?
>> > Thanks
>> > for your involvment.
>> > --
>> > Ilya
>> >
>> >
>>
>>
>>


.


Loading