Hi there
I am having a problems with extracting values from text field. I have text
field (called part number) in my access table. When I extract either in
report or email, it convert itself to date format. Example the value is
4218-06, it will change into 6/1/4218. just look like a date. anyone has any
idea or help me? Appreciate it very much.
Field is Text. Value is 4218-06
Below is my code
"Part # : " & Trim(stpn) & " Qty " & stpoqty & Chr$(13) & Chr$(13) &
Results
Part # : 6/1/4218 Qty 1
Dirk - 18 Jan 2006 09:35 GMT
Hello Norhaya,
Try changing the code to:
"Part # : " & Cstr(Trim(stpn)) & " Qty " & stpoqty & Chr$(13) &
Chr$(13) &
Let me know if that helps.
Regards,
Dirk Louwers
> Hi there
>
[quoted text clipped - 11 lines]
> Results
> Part # : 6/1/4218 Qty 1
norhaya - 18 Jan 2006 10:00 GMT
Hi Dirk
I tried but still the same. :(
> Hello Norhaya,
>
[quoted text clipped - 24 lines]
> > Results
> > Part # : 6/1/4218 Qty 1
Dirk - 18 Jan 2006 10:11 GMT
Well apparently somewhere along the line the value gets explicitly
interpreted as a date. Are you 100% sure that the field in the database table
is indeed a Text or Char field?
Maybe you could try debugging by the inserting:
Debug.Print varThatsSupposedToBeString
right after you have read it from the database. From the recordset for
example.
Do you read the value from a recordset directly or from a bound control?
> Hi Dirk
>
[quoted text clipped - 28 lines]
> > > Results
> > > Part # : 6/1/4218 Qty 1
Van T. Dinh - 18 Jan 2006 12:05 GMT
You wrote that the Field name is [part number]. So what is "stpn" you used
in your expression???

Signature
HTH
Van T. Dinh
MVP (Access)
> Hi there
>
[quoted text clipped - 12 lines]
> Results
> Part # : 6/1/4218 Qty 1