Solved

dtpicker control and format function

Posted on 2001-07-22
6
185 Views
Last Modified: 2012-05-04
i have 2 questions
1- in the DTPicker control i set format to custom, and custom format to hh:mm:ss but when run the program all things is ok except one thing i want the hours to be from 00 to 23 not from 00 to 12 how can i do that?

2- i want to use the format function in order two represent any number in 4 characters only and leave blank (not 0) in the case of the number is less than 4 characters
e.g.

"1234" => "1234"
"12  " => "  45"  (not "0045")
0
Comment
Question by:aft
6 Comments
 
LVL 1

Expert Comment

by:Joshyy
ID: 6306053
instead of hh:mm:ss make the format HH:mm:ss
0
 
LVL 1

Expert Comment

by:Joshyy
ID: 6306057
what do u mean in your second question?
0
 

Author Comment

by:aft
ID: 6306073
i want to display any number in 4 characters if the number is less than 4 charcters add a space or more  before it
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Expert Comment

by:andysalih
ID: 6306351

Private Sub Form_Load()
    Label1.Caption = Format(Now, "Long Time") & vbCrLf & Format(Now, "Medium Time") & vbCrLf & Format(Now, "Short Time") & vbCrLf & Format(Now, "General Date") & vbCrLf & Format(Now, "Long Date") & vbCrLf & Format(Now, "Medium Date") & vbCrLf & Format(Now, "Short Date")
End Sub


shows different samples of time format

is that what you require

regards
Andy
0
 
LVL 3

Expert Comment

by:andysalih
ID: 6306359
0
 
LVL 7

Accepted Solution

by:
Z_Beeblebrox earned 20 total points
ID: 6308447
Hi,

for the number thing:

Space(4 - Len(CStr(intNumber))) & CStr(intNumber)

Zaphod.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MsgBox 2 61
How to incorporate an error traping routing to existing code in VB6 11 49
RUNRMTCMD from AS/400 12 86
Export PDF Form fields to Access  or Excel  in Tab order 16 112
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question