dim H, M, S, AMPM as strings

DTPicker1.Hour = H
DTPicker1.Minute = M
DTPicker1.Second = S
DTPicker1.?????? = AMPM

im having a problem on how i can change the DTpickers AM/PM in codes

im trying to load a time from a database to DTPicker,

ive Split the (field loaded on the database) to H M S
and also AMPM

pls help me on this guys... thanks in advance

Recommended Answers

All 7 Replies

I believe this should get you started...

DTPicker1.Format = dtpCustom
DTPicker1.CustomFormat = "MM/dd/yyyy hh:mm:ss tt"

Good Luck

thx for the reply sir,

but im loading the data i stored in a database to the DTpicker,

how can i set my (strings) to HH:MM:SS TT?

remove the date part of my suggestion...

Good Luck

still cant get it,

heres my code sir

Private Sub SchedMidnightTime()
TOT = RSSchedule.Fields("MidnightTIME")

Me.Show
i = Split(TOT, ":")
H = i(0)
M = i(1)
S = i(2)

d = Split(S, " ")
S = d(0)
ampm = d(1)

'Debug.Print S
'dtMDR is my DTpicker

dtMDR.Hour = H
dtMDR.Minute = M
dtMDR.Second = S
'after ive loaded the Hours,Minutes,Seconds and am/pm  from a 'database i dont know how to load  [QUOTE]ampm[/QUOTE]?
DTPicker1.Format = dtpCustom
DTPicker1.CustomFormat = "hh:mm:ss tt"
DTPicker1.Value = "10:55:23 AM"

Good Luck

commented: thx +1

i hope you try
Text1.Text = Format(DTPicker1, "hh:mm:ss AMPM")

How can i insert a DTPicker in vb4?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.