PDA

View Full Version : Autonumber field



A9992736
12-04-2012, 08:26 PM
I have a field called [Loan_No] in a table. The [Loan_No]'s format is autonumber.

I have another field called [CP_No].

The [CP_No]'s value should be something like "PMB/Loan_No".

How can I derive the [CP_No] value if i need the [Loan_No] as part of its value??

Please assist.

jrajul
12-05-2012, 10:01 PM
Until the new record is updated or saved, the autonumber field has a null value. So your function may lead to division-by-zero errors.

I recommend PMB/NZ([Loan_No],1)

The immediate result will be innaccurate, but will fix itself after the table or record has been refreshed.

you can put docmd.refresh page in the "after insert" event of the form to be certain of the update.

The NZ funtion is only available in Access. If you are working with other programs, you may have to use the iif function instead instead.

A9992736
12-05-2012, 10:11 PM
Until the new record is updated or saved, the autonumber field has a null value. So your function may lead to division-by-zero errors.

I recommend PMB/NZ([Loan_No],1)

The immediate result will be innaccurate, but will fix itself after the table or record has been refreshed.

you can put docmd.refresh page in the "after insert" event of the form to be certain of the update.

The NZ funtion is only available in Access. If you are working with other programs, you may have to use the iif function instead instead.

I have solved the problem. thanks for your advice anyway :)