It is bad database design to put more than one piece of information in a
single field. In your case you want to put a year and a sequence number in
the same field, don't!
If the DCR is a constant, leave it out. If you want to display this on a
form, it is easy to do.
Create a separate field for the year, and another for your sequence number
(I'll call this Seq_No). If Seq_No needs to start over at 001 each year,
then it needs to be an integer or long integer. If it doesn't matter (kinda
like your check numbers) then you could make this anautonumberfield.
If you want Seq_No to start over for each year then on the form you use for
entering your data, you can set the control source of the control that
displays this number to something like:
=NZ(DMAX("Seq_No", "yourTable", "YearField = " Year(Date())), 0) + 1
This assumes that you have a text control (txt_Year) that contains a value
for the current year. To prevent someone from altering this Seq_No, you
should probably lock or disable the txt_Seq_No control on the form.
HTH
Dale
--
Email address is not valid.
Please reply to newsgroup only.
- Show quoted text -