Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - How can I format a phone number in a database form?
How can I format a phone number in a database form?
 
   NeoOffice Forum Index -> NeoOffice Releases
View previous topic :: View next topic  
Author Message
al3
Pure-blooded Human


Joined: Oct 28, 2007
Posts: 34

PostPosted: Tue Mar 08, 2011 6:00 pm    Post subject: How can I format a phone number in a database form?

I have a spreadsheet (imported from CSV) with lots of customer data. I formatted the "phone" column with ###-###-####. Looks nice. I created a datasource from that spreadsheet and from that I created a form so I could see the data a page at a time instead of in sheet format.

However the phone number is not formatted with dashes.... looks like 9876523541 and I want 987-65-23541. I've looked everywhere and tried everything in editing the form...but can't figure how to get it to format with dashes. Can it be done?
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Tue Mar 08, 2011 7:17 pm    Post subject:

You can, but only if you are not using the default input grid in your form. That grid does not have much formatting abilities. Instead, you will need to use a form that was created using the "Create Form in Design View" option in the Forms section.

I have attached a simple database that has a single form called "Form1" that has the "Phone" field formatted like you want. This form was created by doing the following steps:

1. Press the Forms toolbar button in the database and then click on the "Create Form in Design View" option

2. In the window that appears, insert text boxes, list boxes, etc. for each field. The key difference in the "Phone" field is that I inserted a "Pattern Field". To insert that type of field, you need to click on the "More Controls" button in the "Form Controls" toobar. That will display another toolbar that has the "Pattern Field" button.

3. Once you have inserted the "Pattern Field", right-click or Control-click on it and in the popup that appears, select the "Control" menu. In the window that appears, click on the "General" tab and enter the following values:

In the "Edit mask" field enter:
Code:
NNNLNNNLNNNN

In the "Literal mask" field enter:
Code:
___-___-____


Do the above steps work for you?

Patrick
Back to top
al3
Pure-blooded Human


Joined: Oct 28, 2007
Posts: 34

PostPosted: Wed Mar 09, 2011 11:00 am    Post subject:

This looks good. THANK YOU!!

Al
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Releases All times are GMT - 7 Hours
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.