I have custom navigation buttons on my form with a calculated field that counts the records. It works great except when I go to add a new record. The field that calculates the records doesn’t calculate correctly until after I exit the record and go back. I would like to figure out a way to get the calculation to work correctly without leaving the record. Here is an example of my form.
I have three buttons, Go to Previous Record, Go to Next Record, and Add New Record button. Then I have a field that calculates the current record and the total number of records. Example 3 of 3, 2 of 3, 1 of 3. In my case I want the most current record to show first. My problem starts when I click the Add New button, the calculated field changes to 0 of 3 when it should say 4 or 4. I am sure it has to do with the fact that a new record is in the making and until it is saved the calculation can not be accurate. I tried adding code to save record and requery the calculated field in the On click of the Add New Record button but that didn’t work. Any suggestions on how I can make this less confusing when entering a new record.
Here is the calculated field:
=Count(*)-[CurrentRecord]+1 & " of " & Count(*)
I have three buttons, Go to Previous Record, Go to Next Record, and Add New Record button. Then I have a field that calculates the current record and the total number of records. Example 3 of 3, 2 of 3, 1 of 3. In my case I want the most current record to show first. My problem starts when I click the Add New button, the calculated field changes to 0 of 3 when it should say 4 or 4. I am sure it has to do with the fact that a new record is in the making and until it is saved the calculation can not be accurate. I tried adding code to save record and requery the calculated field in the On click of the Add New Record button but that didn’t work. Any suggestions on how I can make this less confusing when entering a new record.
Here is the calculated field:
=Count(*)-[CurrentRecord]+1 & " of " & Count(*)