On Sun, 8 Apr 2007 17:35:40 +0800, "Allen Browne"
<Al*********@Se eSig.Invalidwro te:
>Is there any reason you are looking in the table instead of reading the
value from the form itself? (Access 97 can report the wrong number in
Form_AfterUpda te, and rarely in Form_ BeforeUpdate too, so perhaps you are
trying to avoid this.)
As a matter of fact, I haven't a good reason for reading the table
value instead of reading the AutoNumber field value right off the
form itself. I'm going to start doing just that. None of the other
conditions you pointed out are applicable. Its as if a race condition
exists in the process and the winner is the process trying to read
the new record and the loser is the process writing the new record.
At this point, I don't give a flying shit about the WHY? I'll settle
for the right value - and that will appear in the VehicleJobID field
on the form EVERY time. That much is for certain. Up until yesterday,
I did not have the VehicleJobID field on the data entry form - since
it was not a field that I thought necessary. Big wake up call - here's
a perfectly good reason for it.
Whenever this problem occurred, I've gone back to MAKE SURE THE
NEW RECORD WAS WRITTEN. It was - every single time. For two years,
the procedure in the AfterUpdate code has been reading the new record
ID field value from the table. 99% of the time, it snatches the value
of the NEW record. Every now and then, though, it gets the value of
the last record BEFORE the newly added record is written. I know it
immediately when it happens because letters that should-a-been printed
do not get printed and I find myself going Duhhhhh??????
At first, I was planning on reading the keyfield value of the last
rec in table BEFORE appending a new record, reading it again AFTER
appending the new record and comparing the values to LOOK for this
anomoly. But who the fuck cares about "catching it in the act" of
being wrong. Its too fuckin' late then. I think its a built-in
Micro$oft fuck-up - you know, shit happens. I'd rather have a work-
a-round tthat circumvents the problem than to have the problem and
go "Whoopee! I found it!" I appreciate the feedback.