A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Need to Re-set and Customize Autonumber in a Form



 
 
Thread Tools Display Modes
  #1  
Old March 22nd, 2010, 05:19 PM posted to microsoft.public.access.forms
PHS
external usenet poster
 
Posts: 7
Default Need to Re-set and Customize Autonumber in a Form

I've set up a Form where one of the fields is an Autonumber. I've attempted
to re-set the Autonumber based on the MS Access Help (create an append query
to append number from a temp table that you want to start with), but without
success. The autonumber seems to be "internal" to the form or table and I
can't get it to re-set. Suggestions?
Also, I'd like to tack the current year in front of the Autonumber for new
records created via the Form. For example, 2010-1, 2010-2, 2010-3, etc.,
where 1, 2 and 3 are the autonumbers generated. Tips?
Thanks much in advance.
  #2  
Old March 22nd, 2010, 05:44 PM posted to microsoft.public.access.forms
Golfinray
external usenet poster
 
Posts: 1,597
Default Need to Re-set and Customize Autonumber in a Form

Autonumbers are not intended to be used when you need a record number.
Autonumbers do not have to be sequential. They can just be used as a key if
you don'w have any other useful key. What you might want to do is create a
sequential number with the date in front of it. Doing that in Excel would be
much faster and easier. Then import it to Access and use an update query to
insert it in your table.
--
Milton Purdy
ACCESS
State of Arkansas


"PHS" wrote:

I've set up a Form where one of the fields is an Autonumber. I've attempted
to re-set the Autonumber based on the MS Access Help (create an append query
to append number from a temp table that you want to start with), but without
success. The autonumber seems to be "internal" to the form or table and I
can't get it to re-set. Suggestions?
Also, I'd like to tack the current year in front of the Autonumber for new
records created via the Form. For example, 2010-1, 2010-2, 2010-3, etc.,
where 1, 2 and 3 are the autonumbers generated. Tips?
Thanks much in advance.

  #3  
Old March 22nd, 2010, 05:47 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Need to Re-set and Customize Autonumber in a Form

First, Access Autonumbers are intended for use as unique row identifiers.
Period. As such, they are generally unfit for human consumption.

If you want guaranteed sequential numbers, check on-line for "custom
autonumber".

If you want human-usable "numbers" that look like "2010-1", "2010-2", etc.,
be aware that these are not "numbers"! You don't do math on them, and there
are embedded characters, so they're text. Also be aware that trying to
stuff more than one fact into a single field is poor data design ... and you
appear to be trying to stuff the current year and a sequence number into one
field.

Instead, if your record includes a date/time field, you already know the
year (i.e., Year([YourDateField]), so you don't need to store it again. If
you simply add a SeqNo field and use the above (custom autonumber) approach,
you only need to use a query to concatenate, in a query:

YourCodeNumber: Year([YourDateField]) & "-" & [YourSeqNoField]

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"PHS" wrote in message
...
I've set up a Form where one of the fields is an Autonumber. I've
attempted
to re-set the Autonumber based on the MS Access Help (create an append
query
to append number from a temp table that you want to start with), but
without
success. The autonumber seems to be "internal" to the form or table and I
can't get it to re-set. Suggestions?
Also, I'd like to tack the current year in front of the Autonumber for new
records created via the Form. For example, 2010-1, 2010-2, 2010-3, etc.,
where 1, 2 and 3 are the autonumbers generated. Tips?
Thanks much in advance.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.