Why aren't new records counted?

CarlyS

Registered User.
Local time
Yesterday, 21:56
Joined
Oct 9, 2004
Messages
115
I have a control with a default value of "=count([field1])" in my form header. The form is refreshed after each new record is added so the count can be stored as data for each record. (So the first record stores a 1 and the second record stores a 2 and so on). This works fine when I add all records at once. However, after the form has been closed if I go back in and add a few more records the count is not maintained and the new records store zero. Why does this happen? Is there a way to avoid this starting over effect?

If I enter two records (and they store 1 and 2 consecutively), close the form, and then open it tomorrow and add two more, I want the two new records to store 3 and 4 consecutively. I hope this is clear.

Anyone know what is going on?
 
Carly,

If you want the numbering sequence to start over each day, you are going
to have to have two fields "DayEntered" and "Sequence".

Then, you can use the BeforeInsert event and assign the new "Max Number"
for that day.

Wayne
 
Hi Wayne. I think my explanation was confusing. I actually do not want the count to start over ever. The problem is that it IS starting over.

I read a post by Pat Hartman for someone else's problem that recommended to put a control with Count(*) in the form footer. I tried this and it works sometimes. And it consistently fails for the first record added after the form is opened. Every time I open the form, whether I add one or five more records the first record I add after the form is opened adopts a count of zero, no matter how many records are there. And sometimes a random record returns an inappropriate count.

I have tried adding a refresh command in the after insert event of the form and this has not fixed the problem. Any clue what I'm doing wrong?

You have helped me so much-Thank you!
 
I don't know if this will help anyone understand what I'm doing wrong, but the point of this record count control and refreshing after insert is to create a sequential number label for each group of records. For example:

There main form's records are are student names. Each student can have many behaviors, which are entered on a behavior subform. I want to create a sheet for each student that has current behavior information referenced by the behavior label. I want to label the first seven behaviors on this list behaviors A-G. When behavior A is discontinued, I want the list to read B-G. When another behavior is added the list would read B-H. I want to store the labels but then be able to use them to recall the definitions of these behaviors for summary reports.

I am using the record count on the form to generate the sequential number labels and chr() to convert to letters. I have everything working except the number sequence because the count(*) is not giving the true count. Does that clarify what I am try to achieve?

Thanks always,
Carly
 

Users who are viewing this thread

Back
Top Bottom