selecting type of phone number for specified individuals

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SeadooRider
    New Member
    • Jan 2013
    • 48

    selecting type of phone number for specified individuals

    If I have say (field1...name) , (field2...Comme rcial_Ph), (field3...Bus_P h), field 4...Cell_Ph) etc.

    In a report, can I select which types of phone numbers are displayed next to each individual?

    Ex.
    John Doe Cell: 210-555-1111 Comm: 123-456-8910
    Jane Doe Comm: 210-555-1212
    Lil John Bus: 813-245-6789 Cell: 321-879-1119

    Or would all numbers have to be displayed for all names?

    Ex.
    John Doe Cell: # Comm: # Bus: #
    Jane Doe Cell: # Comm: # Bus: #
    Lil John Cell: # Comm: # Bus: #

    Thanks,
    Jason
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    If you have a way of determining which individual should display which type of phone number, then yes, you can write code to do that.

    Comment

    • SeadooRider
      New Member
      • Jan 2013
      • 48

      #3
      I'm not sure how I would distinguish who gets what type of number displayed...can you explain a little more?

      Thx
      Jason

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        I can't tell you that... you have to tell us that.

        I don't know why you chose to display cell and comm on line 1 but only comm on line 2. I don't know why or how you made that decision not to display the other phone numbers. That's what you have to tell us.

        Comment

        • SeadooRider
          New Member
          • Jan 2013
          • 48

          #5
          several situations could cause the results needed.
          One person may not have a cell or the business phone and/or cell may be the best way to contact a particular individual instead of comm.
          If it seems like a huge amount of work to achieve the results I'll look at alternative ways to display....was just wondering if this would be possible

          Comment

          • Rabbit
            Recognized Expert MVP
            • Jan 2007
            • 12517

            #6
            It'd doable, you just need to clearly define the rules that dictate what gets shown.

            For example, if you want to collapse the blank numbers, then that's a simple matter of concatenating the phone numbers together with a series of if statements to ignore the blank ones.

            If they have a preferred number, then you use an if statement to check which one is preferred and display only that.

            And so on. You just need to define the rules.

            Comment

            • SeadooRider
              New Member
              • Jan 2013
              • 48

              #7
              Sorry for not being able to take more than one step at a time here but how can I mark them as preferred and what might the If statement look like?

              Thx

              Comment

              • Rabbit
                Recognized Expert MVP
                • Jan 2007
                • 12517

                #8
                I'm assuming this data is stored in a database. You would have a field to store which type is preferred by the person.

                If, for example, you wanted to show their cell number only if the cell number field wasn't blank, the if statement would look like this :
                Code:
                If field4 <> "" Then
                   phoneNums = phoneNums & " Cell: " & field4
                End If
                Where phoneNums start out as a blank string and you use if statements to build up what would be shown.

                Comment

                • SeadooRider
                  New Member
                  • Jan 2013
                  • 48

                  #9
                  Ok, I have is so when the user checks the checkbox next to his selected phone numbers, it places and/or combines them in a field called PrefPh. (perfect) However, there is one checkbox that if it is not check, he should not be able to move to the next record until it is checked. I have my code in the "on_current " event, and that works great if you move away from that record and then come back. Once he moves back, if that checkbox is not checked, he gets a msgbox saying "No extension can be checked if there is no commercial phone checked".

                  How can I get it to display that when he tries to move to another record (prev or next)?

                  thanks,
                  Jason

                  Comment

                  • SeadooRider
                    New Member
                    • Jan 2013
                    • 48

                    #10
                    Rabbit,
                    Never mind on that last part, figured it out. I put it under the next event and previous event buttons. Works good.

                    thanks again

                    Comment

                    Working...