I want to combine date field and autonumber field to make a Incident number field in access table and on an Access form
15 9963
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)
Please help need to have date and add autonumber to end of the date.
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.
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.
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)
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.
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.
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)
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
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
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
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
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)
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.
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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....
|
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...
|
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. ...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
| |