Results 1 to 4 of 4
  1. #1
    mikesal57 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2021
    Posts
    53

    Data Type Error?

    Hi All...



    I have this field called tPGM (Program Number)

    It can range from 1-20 but sometimes it can be ...1A or 2B or 3C , etc etc

    I need to export this in Excel but it leaves the fields blank if it has the letter in it..

    .Click image for larger version. 

Name:	1.JPG 
Views:	13 
Size:	100.1 KB 
ID:	49362

    Can this be fixed ?

    Thxs

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,280
    Try prefixing the field with a single quote in a query. Export that.
    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
    mikesal57 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    Mar 2021
    Posts
    53
    Quote Originally Posted by Welshgasman View Post
    Try prefixing the field with a single quote in a query. Export that.
    Thx but I'm lost on that....can you expand please...

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,280
    Something along the lines of
    Code:
    SELECT tblSubmitterInvoice.SubmitterClientID, tblSubmitterInvoice.TransferFeeID, tblSubmitterInvoice.InvoiceRate, "'" & CStr([nvoiceAmount]) AS AmountText, tblSubmitterInvoice.DateInvoiced
    FROM tblSubmitterInvoice;
    I am using my fields here. You could try with and without the Cstr()

    Just create the query in the query designer.
    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

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

Similar Threads

  1. Replies: 2
    Last Post: 09-17-2021, 08:49 AM
  2. Data Type Conversion Error - WHY?
    By Datamulcher in forum Modules
    Replies: 2
    Last Post: 03-13-2017, 06:00 PM
  3. Data type Error
    By Glenn_Suggs in forum Access
    Replies: 3
    Last Post: 01-25-2016, 11:30 AM
  4. Data type mismatch error
    By Tomfernandez1 in forum Programming
    Replies: 5
    Last Post: 10-05-2012, 07:27 AM
  5. Replies: 1
    Last Post: 05-11-2012, 10:59 AM

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