Results 1 to 5 of 5
  1. #1
    webisti is offline The Wisher
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    115

    Transfer spreadsheet formated column

    Hi I am using this code for transfering a query results to excel:
    Private Sub SEND_ACQ_Click()
    Dim Filename As String
    DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12xml, "S_EXPORT", "C:\users\**\S_EXPORT.xlsx", True


    MsgBox " table created" & vbCrLf _
    & "FILE SAVED " & vbCrLf, vbYes + vbInformation, " - SUCCESSFULLY CREATED"
    End Sub
    Actually What I want is that the three colums I do export : Student Name / Phone / birthday should be formated like Text / Number / Date/
    So I want have the famous erro number stored as text.


    Any ideas are appreciated

    Webisti

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Why would you want phone as a number? I just tested export and phone number does not have the warning but zip code does because have only 5 digits. Is the warning really an issue? Data still works.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    webisti is offline The Wisher
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    115
    I must have it as a number, is there any way?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Phone number value is not saved in table with punctuation - parens and hyphens?

    I tested export of phone number from text field saved without punctuation and used Val() function on the field. The column in spreadsheet did not have warning. But I did get an unexpected warning message before the export "Unable to append record" to which I replied Yes and the data exported. Apparently was because some records did not have phone number and the Val() function errors with Null. So if Nulls are possible, try:

    Val(Nz([Fieldname],0))
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    webisti is offline The Wisher
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    115
    Quote Originally Posted by June7 View Post
    Phone number value is not saved in table with punctuation - parens and hyphens?

    I tested export of phone number from text field saved without punctuation and used Val() function on the field. The column in spreadsheet did not have warning. But I did get an unexpected warning message before the export "Unable to append record" to which I replied Yes and the data exported. Apparently was because some records did not have phone number and the Val() function errors with Null. So if Nulls are possible, try:

    Val(Nz([Fieldname],0))
    Thanks the val/nz function worked out...
    great

    Webisti

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

Similar Threads

  1. New workbook/worksheets using Transfer Spreadsheet
    By nyneave in forum Import/Export Data
    Replies: 3
    Last Post: 09-05-2012, 06:44 PM
  2. Transfer Spreadsheet
    By mulefeathers in forum Import/Export Data
    Replies: 1
    Last Post: 05-02-2012, 12:52 PM
  3. Button Command to Transfer Spreadsheet
    By diane802 in forum Programming
    Replies: 3
    Last Post: 02-10-2010, 09:26 AM
  4. Transfer SpreadSheet Command and Rename
    By fintan06 in forum Import/Export Data
    Replies: 2
    Last Post: 10-15-2009, 08:00 AM
  5. File path name using Transfer spreadsheet
    By JohnN in forum Import/Export Data
    Replies: 0
    Last Post: 11-14-2005, 06:57 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