Results 1 to 6 of 6
  1. #1
    HeyMoe is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2023
    Posts
    11

    Numbers As Text in CSV

    This seems it should be easy, but nothing I try is working.

    I have a table that gets updated via a form.
    The table has a few ShortText fields that contain a default value. One of then is a six digit number.
    When I then create a CSV file from this table, the field with this 'number' in it, always shows up with two decimal points!!
    I can't seem to make it a text field!
    (I need it to be a text field when I use this CSV file later on.)

    In the table design, the field is set as ShortText.
    I've tried putting the value within quotes, I've tried putting @ in the Format field.
    I've tried to set the value via the form....


    But every freakin' time, the CSV file shows is as an integer.

    Is there something else I'm forgetting.

    Thanks very much.

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,568
    Use Format() function?
    Alternatively try surrounding with single or double quote.
    Also try the CStr() function.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    HeyMoe is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2023
    Posts
    11
    Quote Originally Posted by Welshgasman View Post
    Use Format() function?
    Alternatively try surrounding with single or double quote.
    Also try the CStr() function.
    Hi Welshgasman. Thanks for the response.
    Done all those.
    Used Format() and CStr(), enclosed the vale in " " and ' '. No change.
    The one thing that's odd, is that the value in the CSV file has '.00' at the end of it.

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,568
    How are you creating the csv?
    Can you upload a sample db?

    I have an old DB with sort code and account number as short text and it comes out as

    Code:
    2,"Royal Air Force Benevolent Fund","R.A.F.B.F","RAF","SF","401175","00811689"
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,180
    Check the export settings, I tried an example with Startingstock = short text. The following settings for a text export without formatting gave the correct csv result:
    Click image for larger version. 

Name:	ExportExample.jpg 
Views:	18 
Size:	45.1 KB 
ID:	52674

  6. #6
    HeyMoe is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2023
    Posts
    11
    Quote Originally Posted by Welshgasman View Post
    How are you creating the csv?
    Can you upload a sample db?
    Just with a simple DoCmd.TransferText acExportDelim.

    While typing this I double checked exactly what I had. For some reason I included a non-existent 'SpecificationName'.

    Jeezus!!!

    Thanks for you help.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 11-11-2020, 08:18 PM
  2. Exporting numbers to CSV from query in Access
    By smoothlarryhughes in forum Import/Export Data
    Replies: 1
    Last Post: 09-01-2019, 02:19 PM
  3. Replies: 16
    Last Post: 08-15-2014, 12:03 PM
  4. Access 2003: import csv fails as csv is still open
    By vanthien in forum Import/Export Data
    Replies: 3
    Last Post: 01-06-2013, 07:46 PM
  5. SendObject Export CSV and Import CSV
    By DetrieZ in forum Import/Export Data
    Replies: 2
    Last Post: 09-19-2012, 04:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums