Is there any way to suppress quotes when writing a string via Write #?
Thanks,
Bill
Is there any way to suppress quotes when writing a string via Write #?
Thanks,
Bill
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.
From Help:
Try using the "PRINT #" command. Sometimes more work, but greater control on what is written to the file.Unlike the Print # statement, the Write # statement inserts commas between items and quotation marks around strings as they are written to the file.
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.
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.
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.
What Orange and June7 said....
I always use "Print #" because have more control on what is written (and I am kinda anal that way...)
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
I understand the HELP text regarding Print # versus Write #. However, I don't know what you mean by "attaching in mdb format"?
Bill
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.