The string that gets into the EXCEL cell will have the ' character at the
beginning (this is what I'd said), but the EXCEL spreadsheet does not
print
it nor display it as part of the value. It is an indicator to EXCEL that
the
value in that cell is text, not numeric.
If you use the same query for a report as you do for the EXCEL export,
then
the report will show a ' character at the beginning of the value --
ACCESS
does not use ' for that purpose, just EXCEL does.
--
Ken Snell
<MS ACCESS MVP>
Brian said:
Tried prepending the ' but this was copied through by Excel.
Added two fields in the query :
HST: IIf([Wkts]=10,Str$([Score]),Str$([Score]) & "-" & Format([Wkts]))
HST2: "'" & [HST]
but these retained the ' character on the report and when sent to
Excel.
--
Brian Box
:
The ' character will not be printed or visible in EXCEL unless you
double-click in the cell to edit the data.
Unfortunately, EXCEL sees the data and guesses at what type it is...
Other
way is to use Automation to manipulate EXCEL after you write the data
into
the worksheet; then you can change the data type in the cells.
--
Ken Snell
<MS ACCESS MVP>
Unfortunately I do not want ' at the head of fields when I print
them
direct
from Accesss. Thanks for the reply.
--
Brian Box
:
You need to tell EXCEL that the text should be handled as text.
Easiest
way
to do this is to export a calculated field where you've prepended a
'
character in front of the string:
MyOutputField: "'" & [NameOfOriginalField]
--
Ken Snell
<MS ACCESS MVP>
I have compiled a text field in Access reports from numbers
(cricket
team
score such as 150-7 with appropriate spacing) but when this is
transferred
to
Access the field is converted to a number (date?). Should the
text
be
compiled at Query stage?