Which event should I use for recordset changed

  • Thread starter Thread starter Tony
  • Start date Start date
T

Tony

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.
 
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."
 
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 said:
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 said:
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.
 
Tony,
I'm confoosed...
You wrote in your original post...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 said:
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 said:
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 said:
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.
 
Tony said:
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.
 
Sorry I had my holidays and just get back.
Remember it's a multi-user environment. So it might be changed by other user
Tony,
I'm confoosed...
You wrote in your original post...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 said:
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 said:
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."

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.
 
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 said:
Tony said:
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)
 
Back
Top