DroidDB Tip of the Month
DroidDB® Tip for February 2012
Autonumbering Records
When creating a new record on the handheld, you may want to assign a unique id to the record (for example, a "person id" or a "part number"). Microsoft Access calls this an "autonumber". As it turns out, it is very easy to create an autonumber in DroidDB also.
Every time DroidDB creates a record on the hanhdled, DroidDB assigns a unique integer value to that record. This unique value is called the record's OID. Within a an expresion, you can get a record's OID by using the @oid function.
To create an autonumber on your form, just create a calculated control. When asked if you want the results of the calulation saved, say YES. In the properties of the control, use @oid as the expression, and make sure you click the "Integer" radio button.