473,387 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

inputting phone number problem

489 256MB
I'm inputting from an .csv file that has a column for phone. the problem is that the phone number is entered two different ways. (555) 123-4567 and 5551234567 I'm loading the .csv file into a table that has the phone set as Short Text, field size 20 and input Mask !\(999") "000\-0000;0;_
When the input is finished the phone numbers with the (555) 123-4567 doesn't input but the 5551234567 does and is formatted like the mask.
I'm using the following code to load the table.
Expand|Select|Wrap|Line Numbers
  1. Docmd.transfertext acimportDelim, , TempFile, Appath, true
Where TempFile is name of the database file and Appath is the location and name of the .csv file.
I'm getting an ImportErrors file that says the phone number with the (555) 123-4567 Type Conversion Failure. Now I have a AltPhone in the same .csv file with the same two different phone formats and that loads just fine. I've checked the .csv file format and they are both the same. Also the database table that is loaded the two columns are the same. So why does one load and the other doesn't. I'm really confused.

Any help is appreciated.
Thanks
Oct 4 '18 #1
5 1153
twinnyfo
3,653 Expert Mod 2GB
You'll have to rip the pre-formetted string apart (as it is a string and NOT a number).

You could build a string checking each character if it is a numeric value and adding it to your final results, and then use that result to fill the final table.
Oct 4 '18 #2
CD Tom
489 256MB
I don't understand why it works with the AltPhone which has the same two types of numbers and it loads just fine. As I mentioned I've checked the two columns both in the .csv file and in the database table and they are both the same. So why one and not the other.
Oct 4 '18 #3
twinnyfo
3,653 Expert Mod 2GB
I just reread your original post. So, BOTH receiving fields are set the same?

Have you tried a copy and paste of the one field that works for the field that does not?

Just trying to throw out possible ideas.

In the original source table for Alt Phone, before it is exported to CSV, is it set up identically to the other phone field?
Oct 5 '18 #4
CD Tom
489 256MB
I've check all fields in both the xlsx file and the converted .csv file and everything is the same.
I'll try doing the copy and paste and see if it makes any difference.
Oct 5 '18 #5
twinnyfo
3,653 Expert Mod 2GB
Still very strange. You may have to resolve it my ripping apart the phone number string.....
Oct 5 '18 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: joemono | last post by:
Hello everyone! First, I appologize if this posting isn't proper "netiquette" for this group. I've been working with perl for almost 2 years now. However, my regular expression knowledge is...
21
by: AnnMarie | last post by:
<script language="JavaScript" type="text/javascript"> <!-- function validate(theForm) { var validity = true; // assume valid if(frmComments.name.value=='' && validity == true) { alert('Your...
6
by: Poewood | last post by:
Is there a way to parse the contents of a textbox into a phone number format? Actually I would like to save the input as a number but display it as a phone number in the typical US format (000)...
4
by: Brian Henry | last post by:
I have phone numbers like this in a data table 123-435-1234 1231231234 432.234.2321 they all have different formatting, what I want to do is get them all formatted like this (123) 123-1234
10
by: JackM | last post by:
I'm still working on validating the phone numbers that are entered on a form but have come across a problem I don't understand how to fix. I can handle most instances when it's in regular US...
2
by: czbacnik | last post by:
Hello! All I want to do is have my phone numbers appear (555) 555-5555, but for some reason I keep getting all these weird -- in between the numbers. I read that I should put "(999) 999-9999"! as...
3
by: venu | last post by:
Hi, I have a different requirement and it is : I need to validate a phone number field. It may or may not be a US phone number. The constraints are : *********************** # It should...
4
by: luke noob | last post by:
This is my HTML... <head> <script type="text/javascript" src="js/jquery-1.2.6.pack.js"></script> <script type="text/javascript" src="js/script.js"></script> </head> <body>
1
by: ONewbie | last post by:
Hello, I am very new to PHP, so I would greatly appreciate your help. I am making a contact form with Name, Email and Phone text boxes. Validating email and name seems to be working fine, but...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.