Results 1 to 10 of 10
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    2,073

    Suppress quotes when writing a string via Write #

    Is there any way to suppress quotes when writing a string via Write #?

    Thanks,
    Bill

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    The quotes are in values of table field?

    Assume x = the value.

    Replace(x,Chr(34),"")
    or
    Replace(x,"""","")

    EDIT: Never used WRITE # and did not correctly understand the issue before reply. See next post by ssanfu.
    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
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    From Help:
    Unlike the Print # statement, the Write # statement inserts commas between items and quotation marks around strings as they are written to the file.
    Try using the "PRINT #" command. Sometimes more work, but greater control on what is written to the file.

  4. #4
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    2,073
    Thanks Steve. Why is Print # more work? Doesn't the output still go to a file?
    Bill
    (PS) This issue is likely becoming academic, as I think I'm going to output my array(x,y) to Excel. But your input is valuable for future reference.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    This is from MS Access help:

    Unlike the Print # statement, the Write # statement inserts commas between items and quotation marks around strings as they are written to the file. You don't have to put explicit delimiters in the list. Write # inserts a newline character, that is, a carriage return–linefeed (Chr(13) + Chr(10)), after it has written the final character in outputlist to the file.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    The point here is that Print # would be more work if you want to include commas in the string to delimit the list. You would have to concatenate values and commas to 'build up' the delimited string. Possibly also CrLf characters to force new lines in the output.
    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.

  7. #7
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    What Orange and June7 said....

    I always use "Print #" because have more control on what is written (and I am kinda anal that way... )

  8. #8
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    2,073
    I understand what you're saying. I was already dealing with a comma delimited string, so all I had to do was change "Write" to "Print" to get the desired csv file without the quotes.

    As it turns out, the changes to the module to output directly to an xls file, while new to me, is/was a valuable learning experience for me and far better in providing input to another Web application.

    Thanks,
    Bill

  9. #9
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    2,073
    I understand the HELP text regarding Print # versus Write #. However, I don't know what you mean by "attaching in mdb format"?
    Bill

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    The reference to mdb format is a note in orange's post signature to advise that attaching an Access db in mdb format (pre-2007) might get more reviews than accdb.

    I have notes in my post signature also. See below.
    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.

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

Similar Threads

  1. New Database on Customer Quotes
    By rkalapura in forum Access
    Replies: 2
    Last Post: 07-13-2012, 07:15 PM
  2. Replies: 7
    Last Post: 03-23-2012, 01:55 PM
  3. Suppress Last Page
    By RayMilhon in forum Reports
    Replies: 2
    Last Post: 03-16-2012, 10:08 AM
  4. Database to produce quotes
    By rossp0203 in forum Database Design
    Replies: 2
    Last Post: 05-26-2011, 10:15 AM
  5. Remove Quotes within Data Values
    By kfschaefer in forum Programming
    Replies: 0
    Last Post: 02-26-2009, 01:15 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