Count(*) not accurate

CarlyS

Registered User.
Local time
Yesterday, 21:49
Joined
Oct 9, 2004
Messages
115
I have a count(*) control in a forms footer which stores its data in a field (total records) for each record. This way, when a new record is added, the count should be one greater than it was for the previous record. This gives each record a consecutive ID for the records grouped on this form. The numbers it returns are not always accurate. I have tried adding a refresh command after insert. Still inconsistently accurate. It is, however, consistently INACCURATE when the form is opened and the first record is added. It counts zero even if there are other records. What can I do to fix this?
Thanks in advance,
Carly
 
I think you are trying to do it the wrong way?

Try Dcount
 
Carly,

Try DMax + 1.

Use the Search Facility here and look for DMax. This is a common topic.

Wayne
 
I got it working with DCount. Thank you guys so much for your help. That is so nice of you to take your time to help other people who don't have a clue like me.
Best,
Carly
 
Carly,

DCount is likely to cause problems if you ever have any record deletions.
DMax + 1 won't have that problem.

Wayne
 
Wayne,
Thank you so much for the heads up. I am actually planning for this form to be add only, but it sounds like the most used method is DMax. I for some reason was having trouble with it yesterday, but I got it working now. Thank you so much for your help. You are so kind!

Carly
 

Users who are viewing this thread

Back
Top Bottom