473,382 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Combine date and autonumber field in Access

28
I want to combine date field and autonumber field to make a Incident number field in access table and on an Access form
Feb 18 '07 #1
15 9963
NeoPa
32,556 Expert Mod 16PB
Please look in this thread and consider adding those items necessary to give an answer.
(POSTING GUIDELINES: Please read carefully before posting to a forum)

MODERATOR.
Feb 18 '07 #2
nico5038
3,080 Expert 2GB
Combining two basic fields into one is considered bad design.
The "normalized" way is to use a composite key, being constructed from both fields. This is achieved by selecting both fields and pressing the Key button in the table design mode.

Finally on a form a "read only" field can be used with an algoritm like:
=[AutoID] & " " & [SequenceNo]
Even formatting could be used to get a 1 displayed like 001.

Getting the idea ?

Nic;o)
Feb 18 '07 #3
DeanO
28
Please help need to have date and add autonumber to end of the date.
Feb 18 '07 #4
ADezii
8,834 Expert 8TB
Please help need to have date and add autonumber to end of the date.
What exactly are you requesting? Is this it?
02/16/2007_1, 02/16/2007_2, 02/16/2007_3, 02/16/2007_4, 02/17/2007_5, etc.
Feb 18 '07 #5
DeanO
28
What exactly are you requesting? Is this it?
02/16/2007_1, 02/16/2007_2, 02/16/2007_3, 02/16/2007_4, 02/17/2007_5, etc.
Yes that is it I will format the autonumber a little different but I do want it at the end like you have it.
Feb 18 '07 #6
nico5038
3,080 Expert 2GB
This is a duplicate post, see:
http://www.thescripts.com/forum/thread604005.html

I'll close this one so all comments can be concentrated in the above thread.

When you have additional information, please add that as a [Reply] to the original thread:-)

Nic;o)
Feb 18 '07 #7
DeanO
28
Combining two basic fields into one is considered bad design.
The "normalized" way is to use a composite key, being constructed from both fields. This is achieved by selecting both fields and pressing the Key button in the table design mode.

Finally on a form a "read only" field can be used with an algoritm like:
=[AutoID] & " " & [SequenceNo]
Even formatting could be used to get a 1 displayed like 001.

Getting the idea ?

Nic;o)
If you do not want to answer this question why even mess with it. At least I got an answer on the page till you closed it out.
Feb 18 '07 #8
DeanO
28
If you do not want to answer this question why even mess with it. At least I got an answer on the page till you closed it out.
This is what I want when I am done Date_AutoNumber (02-18-07-001) I want it done automaticaly for the user.
Feb 18 '07 #9
nico5038
3,080 Expert 2GB
If you do not want to answer this question why even mess with it. At least I got an answer on the page till you closed it out.
Dear DeanO,

Posting the same question twice is considered bad behaviour and spoiling the effort of the experts here at the site. Having two threads will leave the experts unaware of all solutions posted in the other thread and thus multiple identical solutions can be proposed.
The experts here are volunteers and investing their precious spare free time to help others. Gratitude isn't required, but your statement posted here doesn't really help to motivate experts to help you.

Please take a moment to read my proposed solution and comment on that instead of starting a flame. Keep your comments professional and to the subject at hand.

Nic;o)
Feb 18 '07 #10
DeanO
28
Dear DeanO,

Posting the same question twice is considered bad behaviour and spoiling the effort of the experts here at the site. Having two threads will leave the experts unaware of all solutions posted in the other thread and thus multiple identical solutions can be proposed.
The experts here are volunteers and investing their precious spare free time to help others. Gratitude isn't required, but your statement posted here doesn't really help to motivate experts to help you.

Please take a moment to read my proposed solution and comment on that instead of starting a flame. Keep your comments professional and to the subject at hand.

Nic;o)
Thank you. Your answer did not give the results I need. As I understand I need to combine the date field and the autonumber field to get one field. with
02-18-07-001 I have tried this line after update mode. txtbox name = date() & ID
Feb 18 '07 #11
MMcCarthy
14,534 Expert Mod 8TB
DeanO

The experts here volunteer their time to help others with their problem. They are at least deserving of your respect. Site Rules prohibit the double posting of questions as it is confusing for everybody concerned and moderators are operating under instructions to either merge the questions or close/delete one of the questions. There are many great experts on the Access forum who will be more than willing to help you if you do the following.

1. Respect all answers given even if they are incorrect
2. If you don't understand an answer then ask for further clarification
3. If you try an answer and it doesn't work. Then post the full code of what you have tried and a detailed explanation of any error received or why it doesn't suit your requirements.

This site is an invaluable resource which could provide you with ongoing assistance as long as you treat the experts with respect and follow the Posting Guidelines as laid out in the FAQ.

ADMIN

Note: I am merging both questions together
Feb 18 '07 #12
DeanO
28
What exactly are you requesting? Is this it?
02/16/2007_1, 02/16/2007_2, 02/16/2007_3, 02/16/2007_4, 02/17/2007_5, etc.
Yes this is what I want to do
Feb 18 '07 #13
MMcCarthy
14,534 Expert Mod 8TB
Yes this is what I want to do
What are the names of the two fields you are trying to combine. Is the date field a date or text type?

When these two fields combine they will be a text field so make sure the new field is set to text.

Do you want to update existing records or just add this to the after update event of the date field?

Mary
Feb 18 '07 #14
nico5038
3,080 Expert 2GB
Thank you. Your answer did not give the results I need. As I understand I need to combine the date field and the autonumber field to get one field. with
02-18-07-001 I have tried this line after update mode. txtbox name = date() & ID
You should have added a new textbox to the form and set the controlsource to:
=Date() & "-" & format([ID],"000")
also add a (hidden) field with a default value of Date() that's bound to the tablefield that will have to hold the Date().
On a new record this field won't show as long as no autonumber has been assigned by Acccess.

Nic;o)
Feb 19 '07 #15
DeanO
28
You should have added a new textbox to the form and set the controlsource to:
=Date() & "-" & format([ID],"000")
also add a (hidden) field with a default value of Date() that's bound to the tablefield that will have to hold the Date().
On a new record this field won't show as long as no autonumber has been assigned by Acccess.

Nic;o)
Thank you this solved my problem.
Feb 20 '07 #16

Sign in to post your reply or Sign up for a free account.

Similar topics

33
by: Lee C. | last post by:
I'm finding this to be extremely difficult to set up. I understand that Access won't manage the primary key and the cascade updates for a table. Fine. I tried changing the PK type to number and...
3
by: Atreju | last post by:
I have the need to import logs into an Access table. The first field is a date & time field, represented in this example: 05/15/2004 17:58:55.336 This is how the logs are reported. DateTime....
26
by: jimfortune | last post by:
Sometimes I use Autonumber fields for ID fields. Furthermore, sometimes I use those same fields in orderdetail type tables. So it's important in that case that once an autonumber key value is...
1
by: mojo | last post by:
We have set up an Access database with tables x,y, & z where we would like to have multiple people entering data into a table x. Each person has an identical copy of the database on their PC's. ...
5
by: jhutchings | last post by:
Hello everyone, I have a database where I collect shipment data from various tables. However, I have a problem. Whenever I want to see shipping data for orders that were set to ship on or before...
6
by: Luvin lunch | last post by:
Hi, I'm new to access and am very wary of dates as I have limited experience in their manipulation and I know if they're not done properly things can turn ugly quickly. I would like to use a...
11
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any...
20
by: keri | last post by:
Hi, I am creating a table where I want to use the date as the primary key - and to automatically create a record for each working date (eg Mon to Fri) until 30 June 2007. Is this possible? I do...
9
by: Tom_F | last post by:
To comp.databases.ms-access -- I just discovered, to my more than mild dismay, that some tables in my Microsoft Access 2003 database have duplicate numbers in the "AutoNumber" field. (Field...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.