-----Original Message-----
Hi,
What is PONumber? a control? a field name? both? A control belong to the
form, a field belong to the table, to "match" a control to a field, you have
to assign the control property ControlSource to a field name, at design.
Where do you did the assignment? In the onCurrent Event of the form? with
what kind of code:
If Me.NewRecord Then
' we do not want modify EXISTING record, isn't it
Me.PONumberTheControl = Nz(DMax ("PoNumberTheField",
"TheTableNameHere") , 0 ) + 1
End If
Are you in a multi-users environment? If so, have you make a constraint
(index) not allowing duplicated values on the FIELD of the table? And, in
addition, have you trap the possible error in the form onError event? That
would occur if two users try to append a new record at roughly the same
time... they would got the same PO number, but the slowest user would got an
error, telling a duplicated value would occur (since the fastest user got
its record save first, with the new PO number). In the onError event, you
would then tell the problem to the (slow) end user and recompute 1+DMAx(
.... ) as new PO, for that user.
Hoping it may help,
Vanderghast, Access MVP
I have an field that's named Po Number, and this is my
Primary filed .
How can I make that number add itslf and continue a
sequence, for the next page.
Ex: Po Number=40052 , Next page Po Number=40051
I tried the following:
PO Number=Max([Po Number])+1
But it doesn't store the info in th field
.