O
Orv
(Acess2k)
I have a field (RTFnumber) where the input is based on year-record#
(04-0001).
What I want to do is to be able to have the 'new record' display the new#
(the next one) automatically.
I was thinking of using 'primary key' for this, but I don't think I will be
able to change the 'autonumber' when I start entering records in 2005
(ie..05-0001, etc...). Currently my records for the past few years have
never gone over 700 (04-0700) the extra '0' is for 'just in case'.
I think the code below may be the answer, or at least on the right track.
If Me.NewRecord Then
Me!Your Name.Value = Nz(DMax("[YourTableField]", "YourTable"), 0) + 1
End If
Will this do what I want? What do I replace 'Your Name.Value' with?
Thanks, Orv
I have a field (RTFnumber) where the input is based on year-record#
(04-0001).
What I want to do is to be able to have the 'new record' display the new#
(the next one) automatically.
I was thinking of using 'primary key' for this, but I don't think I will be
able to change the 'autonumber' when I start entering records in 2005
(ie..05-0001, etc...). Currently my records for the past few years have
never gone over 700 (04-0700) the extra '0' is for 'just in case'.
I think the code below may be the answer, or at least on the right track.
If Me.NewRecord Then
Me!Your Name.Value = Nz(DMax("[YourTableField]", "YourTable"), 0) + 1
End If
Will this do what I want? What do I replace 'Your Name.Value' with?
Thanks, Orv