I want to have my table to automatically returns current record number.

What functions should I input in default value of this field (indicated in blue arrow) in order to automatically generates number based on their current record?

For example, in this table, it should be filled with number "1". If I create a new record, then it also automatically filled with number "2" respectively.

Current record number:

enter image description here

1 Answer 1


You should set up most of your tables so that they use autonumbers and then the field will be completed for you.

autonumber design view

  • OK, but what I want is I'm going to use the number from "No" field in order to create "ID" which will be based on calculation between "No" field and "Tanggal" field. So the ID will be unique. But what I want is the "No" field value is based on current record number.
    – imsus
    Oct 3, 2012 at 10:02
  • There is no such thing as a fixed current record number in a relational database. The current record number, such that there is one, depends on the sort order of the table. If you wish to assign a sequential number to records, you will need VBA, or just take the easy way and use an autonumber.
    – Remou
    Oct 3, 2012 at 10:11
  • Some code for sequential numbers: stackoverflow.com/questions/11949603/…
    – Remou
    Oct 3, 2012 at 10:14
  • Oh, my bad. I forgot the algorithm won't work when sort and filter is being applied. I guess I will use Autonumber instead. Thanks
    – imsus
    Oct 3, 2012 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.