Results 1 to 6 of 6
  1. #1
    Join Date
    May 2014
    Posts
    98

    Unanswered: Access exports ID instead of percentage

    AQuery drives data from table1 with 3 fields field 1 is autonumber, field 2 is field name and third field has percentages so a data type is %
    When I am using the code below it's transferring the % as ID. so I get field 2 instead of field 3
    Code:
     Dim Book3 As String
         Book3 = "C:\Users\Desktop\1\book3.xlsx"
         DoCmd.TransferSpreadsheet acExport, , "AQuery", Book3
    How can I solve this

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    and the actual query is?
    its far more likely this is a query fault than an export fault.
    as ever you seem to want to play the game of diagnose the fault with my query, but Im not going to tell you what the query itself is.


    see (especially)posts 9 & 10 here. although to be honest the whole thread would benefit from reading and understanding....
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    May 2014
    Posts
    98
    Why are you making fun of me. I face problem and ask for it. you didn't helped me yesterday not helping today and making fun of me Why why why I am just asking for help. Are you trying too say I am an idiot

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so you are using a query to export data to an excel file....
    you are reporting that the wrong value is being sent to the excel file
    ...basic debugging would suggest its almost certainly down to the query...
    ..but you dont' boither posting the query and table design(s) here. so therer is precious little that others can do, short of spenda lot of time trying to coach you to provide the required information

    but as you can't be botherede to post te query design I'd suggest:-
    run the query outside of the export and see what results you get...


    Im guessing that the real reason for the problem is that you have probably used the lookup wizard to enter values as part of the table definition. either that or you haven't joined the main table to a parent table which holds the description of what the number represents. of the two Id put money on it being a lookup table issue. if so the fix is to redesign the data mnodel so that you use a separate table and define a realtional integrity link between the two tables
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    May 2014
    Posts
    98
    SELECT ATable.Results1, ATable.Results2, ATable.Results3, ATable.Results4, ATable.Results5, ATable.Results6, ATable.AName
    FROM ATable;

    Here is my query
    Result field properties:
    datatype = percentage
    Field size single
    Format percentage
    decimal places 2

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    and the table design, the ddl?
    some sample data?
    what you are getting and what you expect
    does the query work as expected, give the results you expect when its run as a stand alone query (IE not exporting to Access)
    Last edited by healdem; 04-09-15 at 08:17.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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