Connecting Tech Pros Worldwide Forums | Help | Site Map

Textbox Formatting Problem !

Prakash Wadhwani
Guest
 
Posts: n/a
#1: Nov 12 '05
I'm importing & displaying data from a legacy DbaseIII+ system.

There's a Numeric field (6 characters) which displays the date in the
following manner: yymmdd (stored as a number in the table).

When I'm displaying this in a text box in my form I'd like it to
display as:
dd/mm/yy (including the slashes).

Can someone please tell me how to go about this ?

Thx & Best Rgds,
Prakash

Phil Stanton
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Textbox Formatting Problem !


Function NumToDate(Num As Long) As Date

Dim DateStg As String, NewDateStg As String
Dim Day As String, Month As String, Year As String

DateStg = Right("0" & CStr(Num), 6)
Day = Right(DateStg, 2)
Month = Mid(DateStg, 3, 2)
Year = Left(DateStg, 2)
NewDateStg = Day & "/" & Month & "/" & Year
NumToDate = CDate(NewDateStg)


End Function

Phil
"Prakash Wadhwani" <simran@omantel.net.om> wrote in message
news:6025a525.0311100954.4c2b59df@posting.google.c om...[color=blue]
> I'm importing & displaying data from a legacy DbaseIII+ system.
>
> There's a Numeric field (6 characters) which displays the date in the
> following manner: yymmdd (stored as a number in the table).
>
> When I'm displaying this in a text box in my form I'd like it to
> display as:
> dd/mm/yy (including the slashes).
>
> Can someone please tell me how to go about this ?
>
> Thx & Best Rgds,
> Prakash[/color]


Prakash Wadhwani
Guest
 
Posts: n/a
#3: Nov 12 '05

re: Textbox Formatting Problem !


Thx Phil !!

It worked a treat !!

Best Rgds,
Prakash.




*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Closed Thread


Similar Microsoft Access / VBA bytes