473,466 Members | 1,538 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

072610-002, ds s combination of Date & ID, the format of date is mmddyy.

180 New Member
072610-002, ds s combination of Date & ID, the format of date is mmddyy.
how cn i make the id back to 001 when the date become 072710, it should appear like this 072710-001
Jul 29 '10 #1

✓ answered by NeoPa

I'm guessing, as I still have no response from you, that the code in codify products may be of some assistance to you. Clearly, you would need to design it on a per-date basis rather than per-category, but the concept appears to be the sort of thing you're after if I guess aright.

19 1614
patjones
931 Recognized Expert Contributor
You need to be a little more clear about what you're trying to do here. To me, it looks like you're asking how to reset the second part of the column back to "001" whenever the date changes, but I can't be sure.

Is that what you want to do? If so, what have you done so far to make it happen?

Pat
Jul 30 '10 #2
eneyardi
180 New Member
thnx alot 4 ur rply. ur corect, i want to reset the ID to 001 when the date changed. Coz i have a MS-Access2007 program-Data Tracking System. I almost done it, this s only my problem left.
in my table design i have field name Doc No, From, Date Receive, To, Date Released, Sender, title, Subject & Addressee. I set the Doc No to autonumber.
and wid ur help after i applied the =Date() & "-" & Format([ID],"000") i got the format i want, but my another problem is my old records became current date which is Doc No: here are my Doc No's before 072610-001, 072710-002, 072910-003, then after i applied the code they became the current date 073010-001, 073010-002, 073010-003 instead of my records date. i want to make the doc no be save, so that when i add records tomorrow, it must be different date. my old record Doc no must not affected. Hope u understand now. pls. help me
Jul 30 '10 #3
patjones
931 Recognized Expert Contributor
I think =Date() & "-" & Format([ID],"000") is a good way to assign the value to that column.

I'm not sure why your old records would update to the current date, unless you are running an update query that somehow acts on all the records in the table.

Pat
Jul 30 '10 #4
NeoPa
32,556 Recognized Expert Moderator MVP
You will need to do a DMax() call into your table. I'd help, but you haven't provided any information on what anything is called. If you can say what the names of the table and the index field are (without using any more abbreviations which are outlawed here) and explain where you are trying to do this coding, then I expect I can give you some example code to get you going with.

Welcome to Bytes!
Jul 31 '10 #5
eneyardi
180 New Member
@NeoPa
i created a table and that is my database, having a field name Doc No. Data type is Autonumber. then i created a form w/c i put a textbox, that textbox is my doc no. and to the datasource i put ur suggested code, and then it is correct that the output for example is 072610-001. but the other case is, i want my database to be updated. can i send to you my program? i admit it, i can't explain it well to you. pls. tell me where can i send mybe u cn give ur email address. pls. help me.. i believe you can help me because all your suggestions/opinion are correct.
Aug 2 '10 #6
eneyardi
180 New Member
yes its act on all records on the table. how can i do these, that when the date changed, the no. will reset to 001, and this date and no. will be saved to my table. pls. help me..
Aug 2 '10 #7
eneyardi
180 New Member
onething, how can i change this date for example 07/26/2010-001 to 072610-001
Aug 2 '10 #8
NeoPa
32,556 Recognized Expert Moderator MVP
Eneyardi,

I am not about to give out my email address, nor do I choose to look at your database at this time. If I ever choose to do that I will let you know.

For now, we are interacting through a forum, which can be complicated, but needn't be too much so for this assuming you can provide consistent logical information.

What we have at this time is a field name [Doc No], but no table name. The field is explained as being of type AutoNumber, yet it is also described as containing non-numeric data (EG. "072610-002"). This is not possible, so it leaves us wondering what you're talking about.
Aug 2 '10 #9
eneyardi
180 New Member
@NeoPa
pls. help me. my table name is table1 and it has a field of doc no w/c data type is autonumber, sender data type is text & addressee data type is also txt. table1 is my database, and i have a form w/c datasource is table1. on that form i put a textbox that the datasource is doc no. the other txtbox is sender and addressee. as i said in my previous question. how can i update the doc no of my database? because the the doc no in the form is combination of date and no. (ex. 072610-001) and i want to make this doc no will reset to 001 when the date becomes 072710. so it should appear 072710-001, and it must save to my database. pls. help me..
Aug 3 '10 #10
eneyardi
180 New Member
@zepphead80
pls. help me..
Aug 3 '10 #11
NeoPa
32,556 Recognized Expert Moderator MVP
It seems you want help, but are unable or unwilling to read what we are saying.

We cannot help you when your question makes so little sense. Please reread what has already been said and then continue by explaining your situation in a way that makes sense. I've explained clearly why it doesn't make sense at the moment. Unless a question makes sense it's impossible to answer it.
Aug 3 '10 #12
patjones
931 Recognized Expert Contributor
I guess what we are confused about (speaking for myself at least) is how the document number gets assigned, and what date you are using. You are saying that the document number is composed of a date, but what date? Today? Yesterday? Some date that the user enters? Are you asking how to assign the document number during the entry and save of a new record?

Pat
Aug 3 '10 #13
eneyardi
180 New Member
The Doc No. is combination of two fields; Date and Autonumber
the date is current date. so the Doc No. is look like this one for example. 072610-001 I've already done this thing, my another problem nw is how can i save this to my database w/c name is table1. because in a form it's look like it only show up but cannot save. I know this is simple but i don't know where to put the coding. pls. help me..
Aug 4 '10 #14
patjones
931 Recognized Expert Contributor
What code are you currently using to save records to the table? Do you have a button on the form or some other control that tells Access to save the information currently in the form?

Pat
Aug 4 '10 #15
eneyardi
180 New Member
i used the command button wizard for saving records.
Aug 5 '10 #16
eneyardi
180 New Member
y u haven't rply? pls.. help me, do you have sample program related to these thing? pls.. let me know..
Aug 5 '10 #17
NeoPa
32,556 Recognized Expert Moderator MVP
eneyardi: y u haven't rply? pls.. help me
The answer is simple. We cannot help when you don't give answers to our questions or respond to our requests.

We cannot do this for you. We can only work with you to help you find a solution that fits your problem.

In the absence of any meaningful replies from you there is very little we can do. I appreciate English may be a difficult language for you. I can sympathise, but it doesn't change the fundamental facts of the matter, which are that we cannot help you without your meaningful responses.
Aug 5 '10 #18
eneyardi
180 New Member
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2. If Me.NewRecord Then
  3. Me.project_sequencenum = DMax("project_sequencenum", "tblprojects") + 1
  4. End If
  5. Me.txtdatesequence = Me.project_date & "-" & Me.project_sequencenum
  6. Me.txtdatesequence = Format(Me.project_date, "yyyymmdd") & "-" & Me.project_sequencenum
Aug 9 '10 #19
NeoPa
32,556 Recognized Expert Moderator MVP
I'm guessing, as I still have no response from you, that the code in codify products may be of some assistance to you. Clearly, you would need to design it on a per-date basis rather than per-category, but the concept appears to be the sort of thing you're after if I guess aright.
Aug 9 '10 #20

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

Similar topics

4
by: Funnyweb | last post by:
I have just notices that the date() function is not returning the correct date/time on my "server". I am running apache2 on my winxp pro laptop. My system clock is set to the correct date,...
2
by: Scott Knapp | last post by:
Good Day - I have a form which sets the current date, as follows: <script type="text/javascript"> xx=new Date() dd=xx.getDate() mm=xx.getMonth()+1 yy=xx.getYear() mmddyy=mm+"/"+dd+"/"+yy...
1
by: Bob Sanderson | last post by:
Does Access have a function to convert a date into a date code (i.e. today's date would be displayed at 051805).
2
by: Bill Nguyen | last post by:
I receive data in an XML file with the following date/time format. While I can parse the date & time using string function, I would like to know if this is some sort of datetime in SQLserver that I...
2
by: fniles | last post by:
How do you do Format(Date, "mmddyy") in VB.NET ? Thank you
2
by: psycho | last post by:
in sqlserver in date is stored in a particular format. Date and time are stored in same column. so if i want to display only date or only time in the datagrid is there any solution?
16
by: Mik | last post by:
I apologise if this post seems a little basic, but I am a newbie and have NO access knowledge. I have downloaded the Accounts Ledger from the Microsoft Website. It allows the user to review a...
4
matrekz42
by: matrekz42 | last post by:
Hello, I currently have a database which consists of about 100 queries. I want to create a button in a form that will run all 100 queries, but at the same time the user can pick the date range, by...
7
by: Rob Nicholson | last post by:
Not sure if this is a good place to post, but we're trying to reverse engineer an Oracle database which has two fields for date & time. They don't seem to be encoded using the standard Oracle...
10
by: kirankumarn | last post by:
I want to validate for From Date & To Date (ie., From Date should not be greater than To Date & also From Date & To Date should not be greater than current date) & Dates are in us format
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.