G
Guest
MS Access 2K, Windows XP
====================
Hi,
I have a text-box control on a form bound to a numeric field. I'd like to
make the default value of this field in a new record to be one more than the
value in the previous record. I already have an Autonumber field in the
table, but I need another field with a similar incrementing property, with
the option of over-riding the default value if needed. The reason is that
usually, the ID increments by one, but sometimes, there are missing IDs, and
in that case, the next ID will be x more than the previous record's ID, where
x > 1.
In the AfterUpdate event of the textbox, I have the following code:
===============================================
Me.SurveyID.DefaultValue = Me.SurveyID + 1
===============================================
This seems to be working fine for every other record. Meaning, that if I
enter the ID as '12' and click on the new record navigation button, the next
record's ID reads '13'. But, when I click on the new record navigation
button, the record ID reads '13' instead of '14'.
What am I doing wrong, and how can I correct it? I've a feeling that the
answer is something obvious, but currently elusive
Thanks for any help/pointers in the right direction.
-Amit
====================
Hi,
I have a text-box control on a form bound to a numeric field. I'd like to
make the default value of this field in a new record to be one more than the
value in the previous record. I already have an Autonumber field in the
table, but I need another field with a similar incrementing property, with
the option of over-riding the default value if needed. The reason is that
usually, the ID increments by one, but sometimes, there are missing IDs, and
in that case, the next ID will be x more than the previous record's ID, where
x > 1.
In the AfterUpdate event of the textbox, I have the following code:
===============================================
Me.SurveyID.DefaultValue = Me.SurveyID + 1
===============================================
This seems to be working fine for every other record. Meaning, that if I
enter the ID as '12' and click on the new record navigation button, the next
record's ID reads '13'. But, when I click on the new record navigation
button, the record ID reads '13' instead of '14'.
What am I doing wrong, and how can I correct it? I've a feeling that the
answer is something obvious, but currently elusive

Thanks for any help/pointers in the right direction.
-Amit