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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • eneyardi
    New Member
    • Jul 2010
    • 180

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

    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
  • patjones
    Recognized Expert Contributor
    • Jun 2007
    • 931

    #2
    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

    Comment

    • eneyardi
      New Member
      • Jul 2010
      • 180

      #3
      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

      Comment

      • patjones
        Recognized Expert Contributor
        • Jun 2007
        • 931

        #4
        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

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32634

          #5
          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!

          Comment

          • eneyardi
            New Member
            • Jul 2010
            • 180

            #6
            Originally posted by NeoPa
            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!
            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.

            Comment

            • eneyardi
              New Member
              • Jul 2010
              • 180

              #7
              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..

              Comment

              • eneyardi
                New Member
                • Jul 2010
                • 180

                #8
                onething, how can i change this date for example 07/26/2010-001 to 072610-001

                Comment

                • NeoPa
                  Recognized Expert Moderator MVP
                  • Oct 2006
                  • 32634

                  #9
                  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.

                  Comment

                  • eneyardi
                    New Member
                    • Jul 2010
                    • 180

                    #10
                    Originally posted by NeoPa
                    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.
                    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..

                    Comment

                    • eneyardi
                      New Member
                      • Jul 2010
                      • 180

                      #11
                      Originally posted by zepphead80
                      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
                      pls. help me..

                      Comment

                      • NeoPa
                        Recognized Expert Moderator MVP
                        • Oct 2006
                        • 32634

                        #12
                        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.

                        Comment

                        • patjones
                          Recognized Expert Contributor
                          • Jun 2007
                          • 931

                          #13
                          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

                          Comment

                          • eneyardi
                            New Member
                            • Jul 2010
                            • 180

                            #14
                            The document no. is combination of two fields; Date and Autonumber

                            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..

                            Comment

                            • patjones
                              Recognized Expert Contributor
                              • Jun 2007
                              • 931

                              #15
                              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

                              Comment

                              Working...