BruceG
Jul 18th, 2000, 02:00 PM
I am creating a text file from an Access DB table, using code similar to the following:
With rsMyTable
...
Write #1, !TextField, !NumField, !YesNoField, !DateField
...
End With
For the text, yesno, and date fields, I get what I expect in my text file: the text field is enclosed in quotes, and the yesno and date fields are enclosed in # symbols. However, the numeric fields (the DB fields are longs and singles)are also being output in quotes when they should not. A sample output record using the code above gives me something like this:
"JOE BLOW","1234",#TRUE#,#2000-07-18#
However, if I put parenthesis around the numeric field reference, I get the results I expect. When I code
With rsMyTable
...
Write #1, !TextField, (!NumField), !YesNoField, !DateField
...
End With
I get:
"JOE BLOW",1234,#TRUE#,#2000-07-18#
(Which is what I expected in the first place.)
Although I can live with the parentheses workaround, I am puzzled as to why the first method caused the numeric fields to be output with quotes as if it was a text field.
Any ideas?
With rsMyTable
...
Write #1, !TextField, !NumField, !YesNoField, !DateField
...
End With
For the text, yesno, and date fields, I get what I expect in my text file: the text field is enclosed in quotes, and the yesno and date fields are enclosed in # symbols. However, the numeric fields (the DB fields are longs and singles)are also being output in quotes when they should not. A sample output record using the code above gives me something like this:
"JOE BLOW","1234",#TRUE#,#2000-07-18#
However, if I put parenthesis around the numeric field reference, I get the results I expect. When I code
With rsMyTable
...
Write #1, !TextField, (!NumField), !YesNoField, !DateField
...
End With
I get:
"JOE BLOW",1234,#TRUE#,#2000-07-18#
(Which is what I expected in the first place.)
Although I can live with the parentheses workaround, I am puzzled as to why the first method caused the numeric fields to be output with quotes as if it was a text field.
Any ideas?