Adding another number digit into my fax database.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MaMister
    New Member
    • Sep 2006
    • 9

    Adding another number digit into my fax database.

    Hi all, I am happy with my fax database until my goverment decided to add another 6 infront of all the phone and fax number.

    How can I change all the numbers together?

    Example from : 1234567 to 61234567

    Thanks.
  • wassimdaccache
    New Member
    • Apr 2007
    • 222

    #2
    You can use a loop to navigate through all records

    and add 6 as string into the phone number field


    dim x as string

    phone_number="6 "+phone_num ber

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      You can just do it with an update query.

      Comment

      • MaMister
        New Member
        • Sep 2006
        • 9

        #4
        Thanks guys, for a simple user like me, the 6 & [FaxFieldName] works well.

        One more question, I found out that there some fax numbers that are not key in correctly, some less 1 digit, some extra 1 digit.

        How can I remove all these?

        Comment

        • Rabbit
          Recognized Expert MVP
          • Jan 2007
          • 12517

          #5
          Try a delete query using Len().

          Comment

          • MaMister
            New Member
            • Sep 2006
            • 9

            #6
            Sorry, what do you mean? If I choose delete query, where to key and what is the full command that I need to key?

            Comment

            • MaMister
              New Member
              • Sep 2006
              • 9

              #7
              I finally got it, its len(FieldName) and =7 in criteria.

              Thanks folks.

              Just curious, how can I ask for 7 digits and 8 digits to be displayed together?

              I tried "=7 and 8" it didn't work out...:)

              Comment

              • Rabbit
                Recognized Expert MVP
                • Jan 2007
                • 12517

                #8
                You have to do Len() = 7 or Len() = 8
                Or you could try Len() In (7,8)

                Comment

                • MaMister
                  New Member
                  • Sep 2006
                  • 9

                  #9
                  Thanks. The In(7,8) works well.

                  One more question please.

                  I have another database from someone else, his input is 1234 5678 but mine is 12345678, how can I remove that spacing in the middle?

                  Comment

                  • Rabbit
                    Recognized Expert MVP
                    • Jan 2007
                    • 12517

                    #10
                    You're looking for the replace function.

                    Comment

                    • MaMister
                      New Member
                      • Sep 2006
                      • 9

                      #11
                      Thanks.

                      I tried the wildcard *#* and it only display the alphabet, but why *?* doesn't display only numbers?

                      Comment

                      • Rabbit
                        Recognized Expert MVP
                        • Jan 2007
                        • 12517

                        #12
                        I'm not sure what you're talking about.

                        Replace(FieldNa me, " ", "") will remove all spaces in a string.

                        Comment

                        • MaMister
                          New Member
                          • Sep 2006
                          • 9

                          #13
                          Oh sorry, I did the replace and it works well. Thanks.

                          I am just trying out this wildcard # and ?.

                          I understand # means alphabet and ? means numbers. (Am I right?)

                          When I try a query the *#* works and only display the alphabet but the *?*didn't seems to work.

                          Comment

                          • Rabbit
                            Recognized Expert MVP
                            • Jan 2007
                            • 12517

                            #14
                            I'd have to see the whole SQL string.

                            Comment

                            Working...