Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Which event should I use for recordset changed

Geek News

Which event should I use for recordset changed
Tony 12/23/2008 3:35:01 PM
Maybe I didn't state clearly in my previous thread.
Let's make it simple.

In a continues form, when user press [F5] or the button [refresh] on the
ribbon, and the records count changed, Is there a way to know that?

Any clues would be appreciated.

Tony.
Re: Which event should I use for recordset changed
"Al Campagna" <newsgroups[ at ]comcast.net> 12/23/2008 5:36:14 PM
Tony,
On my website (below), I have a sample 97 and 2003 file called Record
Statistics.
It shows how to display...
CurrentRecord# "of" RecordsetCount "of" TableCount
If I was on the 10th record of 500, it would display...
10 of 500 of 500
If I filter the form, and get 200 records back, and am on recoird 5, it
would display...
5 of 200 of 500
That should update on Refresh or F5.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"Tony" <Tony[ at ]discussions.microsoft.com> wrote in message
news:C91D916B-541B-4C17-B47D-69F13B576E7B[ at ]microsoft.com...
[Quoted Text]
> Maybe I didn't state clearly in my previous thread.
> Let's make it simple.
>
> In a continues form, when user press [F5] or the button [refresh] on the
> ribbon, and the records count changed, Is there a way to know that?
>
> Any clues would be appreciated.
>
> Tony.


Re: Which event should I use for recordset changed
Tony 12/23/2008 6:34:01 PM
Thanks a lot Al Campagna!

First of all, I would like to focus this senerio:
There's some records in the form, and deleted by other user/form/machine. I
refresh the current form manually by clicking F5 or Refresh, get an empty
form.

I tried your form, it works on your form but doesn't work on mine. After
investigation, I found the reason is: Your form allowed to Add new record,
for mine, Addition is not allowed. I then change your form to Addition is
forbidden, it doesn't work as well.
I tried similar things before, which is I put a textbox, and put '=MyFunc()'
to the datasource field. IT'S NEVER BEEN CALLED IF THERE'S NO RECORDS.

I was stucked here for 2 days!!!!!!

"Al Campagna" wrote:

[Quoted Text]
> Tony,
> On my website (below), I have a sample 97 and 2003 file called Record
> Statistics.
> It shows how to display...
> CurrentRecord# "of" RecordsetCount "of" TableCount
> If I was on the 10th record of 500, it would display...
> 10 of 500 of 500
> If I filter the form, and get 200 records back, and am on recoird 5, it
> would display...
> 5 of 200 of 500
> That should update on Refresh or F5.
> --
> hth
> Al Campagna
> Microsoft Access MVP
> http://home.comcast.net/~cccsolutions/index.html
>
> "Find a job that you love... and you'll never work a day in your life."
>
> "Tony" <Tony[ at ]discussions.microsoft.com> wrote in message
> news:C91D916B-541B-4C17-B47D-69F13B576E7B[ at ]microsoft.com...
> > Maybe I didn't state clearly in my previous thread.
> > Let's make it simple.
> >
> > In a continues form, when user press [F5] or the button [refresh] on the
> > ribbon, and the records count changed, Is there a way to know that?
> >
> > Any clues would be appreciated.
> >
> > Tony.
>
>
>
Re: Which event should I use for recordset changed
"Al Campagna" <newsgroups[ at ]comcast.net> 12/24/2008 12:18:49 AM
Tony,
I'm confoosed...
You wrote in your original post...
[Quoted Text]
> > ribbon, and the records count changed, Is there a way to know that?
If you have Allow Additions = No... then how would the recordset count
change?

I tested my statistics on a Allow Additions = No form, and they work
when moving from record to record, or when filtering the recordset.
But, of course... there is no such thing as adding to the total records.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


"Tony" <Tony[ at ]discussions.microsoft.com> wrote in message
news:196BB16F-8E2F-45C8-9724-C84DF4A141F7[ at ]microsoft.com...
> Thanks a lot Al Campagna!
>
> First of all, I would like to focus this senerio:
> There's some records in the form, and deleted by other user/form/machine.
> I
> refresh the current form manually by clicking F5 or Refresh, get an empty
> form.
>
> I tried your form, it works on your form but doesn't work on mine. After
> investigation, I found the reason is: Your form allowed to Add new record,
> for mine, Addition is not allowed. I then change your form to Addition is
> forbidden, it doesn't work as well.
> I tried similar things before, which is I put a textbox, and put
> '=MyFunc()'
> to the datasource field. IT'S NEVER BEEN CALLED IF THERE'S NO RECORDS.
>
> I was stucked here for 2 days!!!!!!
>
> "Al Campagna" wrote:
>
>> Tony,
>> On my website (below), I have a sample 97 and 2003 file called Record
>> Statistics.
>> It shows how to display...
>> CurrentRecord# "of" RecordsetCount "of" TableCount
>> If I was on the 10th record of 500, it would display...
>> 10 of 500 of 500
>> If I filter the form, and get 200 records back, and am on recoird 5,
>> it
>> would display...
>> 5 of 200 of 500
>> That should update on Refresh or F5.
>> --
>> hth
>> Al Campagna
>> Microsoft Access MVP
>> http://home.comcast.net/~cccsolutions/index.html
>>
>> "Find a job that you love... and you'll never work a day in your
>> life."
>>
>> "Tony" <Tony[ at ]discussions.microsoft.com> wrote in message
>> news:C91D916B-541B-4C17-B47D-69F13B576E7B[ at ]microsoft.com...
>> > Maybe I didn't state clearly in my previous thread.
>> > Let's make it simple.
>> >
>> > In a continues form, when user press [F5] or the button [refresh] on
>> > the
>> > ribbon, and the records count changed, Is there a way to know that?
>> >
>> > Any clues would be appreciated.
>> >
>> > Tony.
>>
>>
>>


Re: Which event should I use for recordset changed
"Dirk Goldgar" <dg[ at ]NOdataSPAMgnostics.com.invalid> 12/25/2008 5:13:37 AM
"Tony" <Tony[ at ]discussions.microsoft.com> wrote in message
news:C91D916B-541B-4C17-B47D-69F13B576E7B[ at ]microsoft.com...
[Quoted Text]
> Maybe I didn't state clearly in my previous thread.
> Let's make it simple.
>
> In a continues form, when user press [F5] or the button [refresh] on the
> ribbon, and the records count changed, Is there a way to know that?
>
> Any clues would be appreciated.


Tony, I can think of an ugly, inefficient way. I hope there's a better way,
but so far the only way I can think of is to use the form's Timer event to
compare the form's currrent record count to a value that was previously
saved in a static or module-level variable. I don't know of any event that
fires when the form is just refreshed.

But I'm not sure that the form's record count will change if it is merely
refreshed, rather than requeried. I *think* the record count won't change,
though ay deleted records will be shown with #DELETED in all fields.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Re: Which event should I use for recordset changed
Tony 12/29/2008 10:02:05 PM
Sorry I had my holidays and just get back.
Remember it's a multi-user environment. So it might be changed by other user
on another machine or another form.

"Al Campagna" wrote:

[Quoted Text]
> Tony,
> I'm confoosed...
> You wrote in your original post...
> > > ribbon, and the records count changed, Is there a way to know that?
> If you have Allow Additions = No... then how would the recordset count
> change?
>
> I tested my statistics on a Allow Additions = No form, and they work
> when moving from record to record, or when filtering the recordset.
> But, of course... there is no such thing as adding to the total records.
> --
> hth
> Al Campagna
> Microsoft Access MVP
> http://home.comcast.net/~cccsolutions/index.html
>
> "Find a job that you love... and you'll never work a day in your life."
>
>
> "Tony" <Tony[ at ]discussions.microsoft.com> wrote in message
> news:196BB16F-8E2F-45C8-9724-C84DF4A141F7[ at ]microsoft.com...
> > Thanks a lot Al Campagna!
> >
> > First of all, I would like to focus this senerio:
> > There's some records in the form, and deleted by other user/form/machine.
> > I
> > refresh the current form manually by clicking F5 or Refresh, get an empty
> > form.
> >
> > I tried your form, it works on your form but doesn't work on mine. After
> > investigation, I found the reason is: Your form allowed to Add new record,
> > for mine, Addition is not allowed. I then change your form to Addition is
> > forbidden, it doesn't work as well.
> > I tried similar things before, which is I put a textbox, and put
> > '=MyFunc()'
> > to the datasource field. IT'S NEVER BEEN CALLED IF THERE'S NO RECORDS.
> >
> > I was stucked here for 2 days!!!!!!
> >
> > "Al Campagna" wrote:
> >
> >> Tony,
> >> On my website (below), I have a sample 97 and 2003 file called Record
> >> Statistics.
> >> It shows how to display...
> >> CurrentRecord# "of" RecordsetCount "of" TableCount
> >> If I was on the 10th record of 500, it would display...
> >> 10 of 500 of 500
> >> If I filter the form, and get 200 records back, and am on recoird 5,
> >> it
> >> would display...
> >> 5 of 200 of 500
> >> That should update on Refresh or F5.
> >> --
> >> hth
> >> Al Campagna
> >> Microsoft Access MVP
> >> http://home.comcast.net/~cccsolutions/index.html
> >>
> >> "Find a job that you love... and you'll never work a day in your
> >> life."
> >>
> >> "Tony" <Tony[ at ]discussions.microsoft.com> wrote in message
> >> news:C91D916B-541B-4C17-B47D-69F13B576E7B[ at ]microsoft.com...
> >> > Maybe I didn't state clearly in my previous thread.
> >> > Let's make it simple.
> >> >
> >> > In a continues form, when user press [F5] or the button [refresh] on
> >> > the
> >> > ribbon, and the records count changed, Is there a way to know that?
> >> >
> >> > Any clues would be appreciated.
> >> >
> >> > Tony.
> >>
> >>
> >>
>
>
>
Re: Which event should I use for recordset changed
Tony 12/29/2008 10:04:05 PM
Sorry I had my holidays and just get back.

Yes that's probably the only way that I can think of, - it's really urgly.
plus, to get the real count of the recordset, i can use DCount. that is
accurate.

"Dirk Goldgar" wrote:

[Quoted Text]
> "Tony" <Tony[ at ]discussions.microsoft.com> wrote in message
> news:C91D916B-541B-4C17-B47D-69F13B576E7B[ at ]microsoft.com...
> > Maybe I didn't state clearly in my previous thread.
> > Let's make it simple.
> >
> > In a continues form, when user press [F5] or the button [refresh] on the
> > ribbon, and the records count changed, Is there a way to know that?
> >
> > Any clues would be appreciated.
>
>
> Tony, I can think of an ugly, inefficient way. I hope there's a better way,
> but so far the only way I can think of is to use the form's Timer event to
> compare the form's currrent record count to a value that was previously
> saved in a static or module-level variable. I don't know of any event that
> fires when the form is just refreshed.
>
> But I'm not sure that the form's record count will change if it is merely
> refreshed, rather than requeried. I *think* the record count won't change,
> though ay deleted records will be shown with #DELETED in all fields.
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net