Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mask Edit With Time

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I'm using a mask edit textbox with a format of ##:## to enter times in a sql DB. inserting records works fine.

Now I want to edit the record and keep the existing mask of ##:## but am having a problem when bringing in the data.

I have tried text1.mask = rs.fields("blaa")

I have also tried to use the seltext as well.

I can get the data to show but it comes over with the wrong format. say the user enter 06:05 (which is 6:05am)
the textbox shows 60:50 - since Sql server drops the first 0 how do I format the textbox ?

any help would be appreciated

 


hi,

Date/Time values are NUMBERS like right now in N Texas the Date/Time value is 40988.6153. The fractional part, .6153 is that part of a day that can be FORMATTED as 14:46.

Use the TimeSerial function to CONVERT your string to a Time Value

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Okay,

thanks... why is the mask box locked after the textbox gets filled in with data. I must be doing something else wrong. I still cannot see, to convert the data correctly. do I convert the mask ?? or the text that goes in the mask. it makes sense that I should conert the text but then the mask dows not get formatted correctly.

 

How is the field defined in your data base that holds the value for you time, when "user enter 06:05 (which is 6:05am)"

Is it Number? Text? Date?

Looks to me you store it as a Number 605, but I may be wrong.

Have fun.

---- Andy
 

So if you enter 06:05, what do you actually get in this datetime field in your sql 2005 server? Have you looked?

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top