Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 23rd, 2005, 02:24 AM
Authorized User
 
Join Date: Feb 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with format

Hi
 I am have the following problem with format. Can anyone help?

Here is I want to accomplish.
    DOB = "0507590635"
    txt2.Text = Format(DOB, "######" & "-" & "####")

It should be like this
   txt2.Text ="050759-0635"

But the result is wrong.It gives
    txt2.Text = "50759-0635"

The leading zero disapear.

Any ideas or a different solution.

Thanks in advance
Karsten




 
Old May 23rd, 2005, 12:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Format(dob, "000000" & "-" & "0000")

 
Old May 25th, 2005, 08:16 AM
Authorized User
 
Join Date: Feb 2004
Posts: 44
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi marcostraf
Thanks a lot.

Cheers
Karsten






Similar Threads
Thread Thread Starter Forum Replies Last Post
Footer Format Problem rstelma ASP.NET 2.0 Professional 0 August 14th, 2008 04:48 PM
Date format problem abhishekkashyap27 C# 2005 1 June 23rd, 2008 02:25 AM
Date Format Problem cyberddindia Classic ASP Basics 2 October 23rd, 2006 01:49 AM
Date Format Problem Scripts82 Access VBA 2 March 13th, 2006 09:36 PM
Date format problem widad Classic ASP Basics 1 October 15th, 2004 06:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.