Autonumber in a form

  • Thread starter Thread starter Tyler
  • Start date Start date
T

Tyler

I have a form that allows data entry and additions only. What I would
like to do is have the record number pop up in a field on the form.

Im not sure how to write the code for the event procedure to be able
to do this. What would be convienient is that the number would pop up
as soon as the form is opened.

any suggestions?
 
Tyler

Perhaps you and I have a different understanding of "Autonumber"...

The Access Autonumber is a system-generated unique key value, whose only
(OK, whose primary) use is as a unique row identifier. Since you have no
control over the value Access comes up with (and there can be 'gaps' in the
sequence, causing severe heartburn for auditors), you're best not even
showing the user the value (i.e., they are generally unfit for human
consumption).

Also, if your data is in an Access (i.e., JET) back-end, the "next"
Autonumber is assigned when the new record is first "dirtied" (i.e., data
added to it). However, if your back-end/data is in SQL-Server, SQL-Server
does not assign an autonumber-equivalent until AFTER you save the record.

?More than you needed to know?
 
Well actually here's the "real" problem.

For the current file system in place the coding goes as such "CI YY/
000" YY being the last two digits of the current year and 000 being
the three digit area where numbers can be inputed.

I've created a mask that forces the user to type in two letters (CI) a
space and the current year but the user doesn't know which record it
is which is why i wanted the autonumber to pop up. This would enable
the user to input CI 07/001 for the first record and continue this
way. When the autonumber is 10 then the user would see the 10 and
enter CI 07/010.

I think im probably making this more complicated than it needs to be.
What would be best is if I could get this all automated but I have no
idea how to do this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top