How to Display date in text box?

I need to display date in textbox but i cant success because it will auto change to mm-dd-yy, what i need is in this format 07-Jan-04.
i try to change to this format in database also cannot . help

Comments

  • [b][red]This message was edited by Diwakar Bista at 2004-12-11 13:30:21[/red][/b][hr]
    hi there

    i have writtern few lines which will solve your problem
    if you face any problem concerning the codes feel free to mail me


    Dim today As String, day As String, year As String, month As String

    today = Date
    year = Right(today, 4)
    'if you need 04 instead of 2004 replace (today,4)by (today,2)
    month = Left(today, 2)

    If Len(today) = 8 Then
    day = Mid(today, 3, 1)

    ElseIf Len(today) = 10 Then
    day = Mid(today, 4, 2)

    ElseIf Len(today) = 9 Then
    If Mid(today, 3, 1) = "/" Then
    day = Mid(today, 4, 1)
    ElseIf Mid(today, 2, 1) = "/" Then
    day = Mid(today, 3, 2)
    End If
    End If

    month = MonthName(Val(month), True)
    today = day & " " & "-" & " " & month & " " & "-" & " " & year
    Text1.Text = today 'text1 is the textbox where date is to be displayed


  • : I need to display date in textbox but i cant success because it will auto change to mm-dd-yy, what i need is in this format 07-Jan-04.
    : i try to change to this format in database also cannot . help
    :

  • : I need to display date in textbox but i cant success because it will auto change to mm-dd-yy, what i need is in this format 07-Jan-04.
    : i try to change to this format in database also cannot . help
    :

  • : I need to display date in textbox but i cant success because it will auto change to mm-dd-yy, what i need is in this format 07-Jan-04.
    : i try to change to this format in database also cannot . help
    :
    Dim da$, mont$, yer$
    Dim d As Date
    d = Format(Date, "d, mmm, yy")
    da = day(d)
    mont = MonthName(month(d)) 'MonthName(month[, abbreviate])
    yer = year(d)
    yer = Mid$(yer, 3, 2)
    s = da & " - " & mont & " - " & yer
    tex1.text=s 'prints 07 - December - 04
    try to abriviate the month name if you want
  • : I need to display date in textbox but i cant success because it will auto change to mm-dd-yy, what i need is in this format 07-Jan-04.
    : i try to change to this format in database also cannot . help
    :
    For the text box called D:

    D=format(date,"dd-mmm-yy")


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories