Alpha Video Training
Results 1 to 8 of 8

Thread: Formating Phone Numbers

  1. #1
    Member
    Real Name
    B Philip Gerber
    Join Date
    Nov 2003
    Location
    St. Charles Mo.
    Posts
    105

    Default Formating Phone Numbers

    I would like to have the system format phone Numbers from 10 pos. numbers to (999) 999-999 format. If you look in the screens you can put format for some types of fields. But not Phone numbers, this would be a great place for the "edit" numbers to be, it evens states "Simple Mask" but not one for Phone numbers, and we all have a need for Phone numbers in data bases.

    I would also like to be able to add this to my current system if some one could show me how a simple format (10 pos. numbers) to the (999) 999-9999.
    Again I would like to put the edit as a normal thing. I have tried some of the things in this form but I have not had any luck.

    I would like to be able run an update to my file and change all my current records.

    Thanks BP Gerber

  2. #2
    VAR
    Real Name
    Martin W. Cole
    Join Date
    Apr 2000
    Location
    Terrell, Texas (near Dallas)
    Posts
    5,957

    Default

    if it is a character field, which phone numbers should be, you have a phone format choice in field rules for the table - although one usually makes the field 14 characters wide

  3. #3
    Member
    Real Name
    B Philip Gerber
    Join Date
    Nov 2003
    Location
    St. Charles Mo.
    Posts
    105

    Default Set up for Phone Field

    In the Data Entry segment I have the Following

    Required [Always ]

    Mask Style [Simple mask ]

    Mask (000) 000-0000

    [] Do Not store mask Literls in field

    [] Auto advance

    [] Auto advance

    Default Mode No Defaults

    skip

    Position Cursor [End of selected Text ]


    I guess I did not set it up right! or what should I set it up like?

    Thanks
    Philip

  4. #4
    VAR
    Real Name
    Martin W. Cole
    Join Date
    Apr 2000
    Location
    Terrell, Texas (near Dallas)
    Posts
    5,957

    Default

    is the field width 14?
    as I recall, if you add a mask to existing data, you will most likely have to run an operation to reset the data - but for new records it should work as described

  5. #5
    Member
    Real Name
    B Philip Gerber
    Join Date
    Nov 2003
    Location
    St. Charles Mo.
    Posts
    105

    Default Field is 14

    Martin the field is 14 charters long. I just tried it again and this time I deleted the number and key it in again and it worked. I have to reload the file again but it is late so I will try it again Tue and let you know how it worked.
    thanks

  6. #6
    Member
    Real Name
    Doug Page
    Join Date
    Jan 2002
    Location
    Vancouver, BC Canada
    Posts
    963

    Default

    I do not believe that the mask works for IMPORTED records. It is a DATA ENTRY field rule and will only apply to records as they are input. If you need to alter imported records, do the import and then do an OPERATION to alter the field. The mask will only look after NEW records entered.

    Doug

  7. #7
    VAR
    Real Name
    Martin W. Cole
    Join Date
    Apr 2000
    Location
    Terrell, Texas (near Dallas)
    Posts
    5,957

    Default

    heres a script you could try:

    t=table.open("phonetable")
    t.fetch_first()
    while .not. t.fetch_eof()
    t.change_begin()
    temp=t.phonefield
    t.phonefield="22"
    t.phonefield=temp
    t.change_end(.t.)
    t.fetch_next()
    end while
    t.close()

    if that doesn't do it,
    try he following:
    t=table.open("phonetable")
    t.fetch_first()
    while .not. t.fetch_eof()
    temp=t.phonefield
    t.change_begin()
    t.phonefield="22"
    t.change_end(.t.)
    t.change_begin()
    t.phonefield=temp
    t.change_end(.t.)
    t.fetch_next()
    end while
    t.close()

  8. #8
    VAR csda1's Avatar
    Real Name
    Ira J Perlow
    Join Date
    Apr 2000
    Location
    Boston, Massachusetts, USA
    Posts
    3,530

    Default

    Martin,

    Or he could try a global update using the UDF function I posted in the code archive at

    http://msgboard.alphasoftware.com/al...ad.php?t=59345

    to correct formatting problems with the phone number.
    Regards,

    Ira J. Perlow
    Computer Systems Design


    CSDA A5 Products
    New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
    CSDA Barcode Functions

    CSDA Code Utility
    CSDA Screen Capture



Similar Threads

  1. Populating and Formating ???
    By Newton Thomas in forum Alpha Five Version 5
    Replies: 0
    Last Post: 10-06-2004, 08:16 AM
  2. Formating fields
    By Fred Daniel in forum Alpha Five Version 5
    Replies: 8
    Last Post: 06-26-2003, 08:09 PM
  3. Formating Field
    By Ray in forum Alpha Five Version 5
    Replies: 3
    Last Post: 04-04-2003, 05:11 AM
  4. Phone Numbers
    By Dennis Hughes in forum Alpha Five Version 4
    Replies: 4
    Last Post: 07-27-2001, 04:34 AM
  5. Missing Numbers and Numbers Out of Order
    By Cheryl Franklin in forum Alpha Five Version 4
    Replies: 2
    Last Post: 12-20-2000, 11:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •