numbering data problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mdtam
    New Member
    • Jan 2013
    • 22

    numbering data problem

    hi experts..

    i would like to store several data in one field in ms access. i use this code to split and numbering the data..
    Code:
    Dim lines() As String, ixx As Integer
    
        lines() = Split(Text1.Text, ",")
    For ixx = 0 To UBound(lines)
        Text3.Text = Text3 & (ixx + 1) & ": " & lines(ixx) & vbCrLf
    next
    everything's going well until i store other data in the same field. the number not continue but restart to number 1.
    1. visual basic
    2. computer
    1.mathematic

    thanks for your help.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    You should not store more than one piece of data in a field. That breaks the rules of normalization.

    Comment

    • mdtam
      New Member
      • Jan 2013
      • 22

      #3
      even memo in ms access?i put them under January field so when i choose January at combobox,data report will shows the data.i use one table only.any idea?

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        Even in a memo field. You shouldn't even have a January field. It's hard to help without knowing anything about the design and purpose of your database.

        Comment

        • mdtam
          New Member
          • Jan 2013
          • 22

          #5
          PBS-KSSR.zip
          here is my ms access database..each number(111,121. ..) holds
          a statement..when the numbers being checked the statements will show in month fields(Jan,FEb. .) arrange with numbering.

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            As a rule of thumb, I do not download files from stranger. Please describe it in the thread instead.

            Comment

            • zmbd
              Recognized Expert Moderator Expert
              • Mar 2012
              • 5501

              #7
              As Rabbit pointed out:
              A Tutorial for Access
              Database Normalization and Table Structures.

              Comment

              • mdtam
                New Member
                • Jan 2013
                • 22

                #8
                ok i explain in more details..
                i use vb6 and msaccess 2007 with ado.In vb6, i got a combobox(Jan,Fe b...) and several checkboxes labeled with 111,121,131..In my msaccess i got field of name,111,121,13 1...,Jan,Feb till Dec. For example when user select Jan(combobox) and 111 and 121(checkbox) in vb6 ,their statement will write in database under Jan with numbering format.If the user select again 131 in Jan,the numbering not sequence properly..that' s my problem :)

                Comment

                • Rabbit
                  Recognized Expert MVP
                  • Jan 2007
                  • 12517

                  #9
                  You should read those articles z linked.

                  As far as your design, you still haven't given us any additional detail that you haven't stated before. So I can only repeat what I've said. The design is not normalized and you should not have:

                  1) More than one value in a field.
                  2) Multiple fields for the 12 months.

                  Comment

                  • mdtam
                    New Member
                    • Jan 2013
                    • 22

                    #10
                    i know how to normalize my Database but i have to start from the beginning. Rewrite the whole code..mess with data report and everything. Since this is only my last problem i need to overcome then my program will complete..anywa y thanks experts..if you have any idea about the numbering i appreciate that..thanks again.

                    Comment

                    • Rabbit
                      Recognized Expert MVP
                      • Jan 2007
                      • 12517

                      #11
                      I just wanted you to be aware that any future changes will be more complicated and take more time on an unnormalized database as opposed to taking the time to do it right in the beginning.

                      As far as your numbering problem, if your goal is to append the data and get the numbering correct, then you need to start your numbering from the original number plus 1. You can get that by splitting the original data and getting the number of elements in the resulting array.

                      Comment

                      • mdtam
                        New Member
                        • Jan 2013
                        • 22

                        #12
                        thanks rabbit..you are the best..now i can compile my program..next time i will normalized my database first before start project..actual ly just learned programming couples of weeks ago..:)

                        Comment

                        • Rabbit
                          Recognized Expert MVP
                          • Jan 2007
                          • 12517

                          #13
                          Glad you got it working, good luck with your project.

                          Comment

                          Working...