Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

Problems with extracting numeric values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
norhaya - 18 Jan 2006 09:25 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.