Clicking calendar date transfer it into a textbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mesubham
    New Member
    • Nov 2007
    • 11

    Clicking calendar date transfer it into a textbox

    In VB toolbox, I put a window calendar, I have also put a textbox beside calendar. What is the code of VB6, when I click on calendar date, it will transfer to the textbox in dd/mm/yyyy format?
    Last edited by Killer42; Nov 22 '07, 02:08 AM.
  • lotus18
    Contributor
    • Nov 2007
    • 865

    #2
    Originally posted by mesubham
    In VB toolbox,I put a window calendar,I have also put a textbox beside calendar,wat is the code of VB6,when I click on calendar date,It will transfer to the textbox in dd/mm/yyyy format....
    Just copy the value property of the window calendar (click event) to the textbox.

    Comment

    • debasisdas
      Recognized Expert Expert
      • Dec 2006
      • 8119

      #3
      You need to manually format the date.

      Comment

      • lotus18
        Contributor
        • Nov 2007
        • 865

        #4
        Originally posted by mesubham
        In VB toolbox,I put a window calendar,I have also put a textbox beside calendar,wat is the code of VB6,when I click on calendar date,It will transfer to the textbox in dd/mm/yyyy format....
        Hi mesubham

        Why don't you try the DTPicker? It has a nicer UI than the Window Calendar anyway they have just the same functions I think. : )
        Last edited by Killer42; Nov 22 '07, 02:07 AM.

        Comment

        • QVeen72
          Recognized Expert Top Contributor
          • Oct 2006
          • 1445

          #5
          Originally posted by mesubham
          In VB toolbox,I put a window calendar,I have also put a textbox beside calendar,wat is the code of VB6,when I click on calendar date,It will transfer to the textbox in dd/mm/yyyy format....
          Try This :

          [code=vb]
          Text1.Text = Format(Calander 1.Value,"dd/mm/yyyy")
          [/code]

          Regards
          Veena

          Comment

          • mesubham
            New Member
            • Nov 2007
            • 11

            #6
            I have written the code in calendar1 click event.
            Text1.Text = Format(Calander 1.Value, "dd/mm/yyyy")

            It gives an error........Ob ject required, ERROR runtime 424

            Help.
            Last edited by Killer42; Nov 22 '07, 02:09 AM.

            Comment

            • Killer42
              Recognized Expert Expert
              • Oct 2006
              • 8429

              #7
              Originally posted by mesubham
              It gives an error........Ob ject required, ERROR runtime 424
              Assuming this code was copied accurately to TheScripts, I'd say the error is caused by the fact that you mis-typed the name of your control.

              Comment

              • QVeen72
                Recognized Expert Top Contributor
                • Oct 2006
                • 1445

                #8
                Originally posted by mesubham
                I have written the code in calendar1 click event.
                Text1.Text = Format(Calander 1.Value, "dd/mm/yyyy")

                It gives an error........Ob ject required, ERROR runtime 424

                Help.
                Hi,

                Sorry, Spelling mistake there..

                Text1.Text = Format(Calendar 1.Value, "dd/mm/yyyy")

                Regards
                Veena

                Comment

                Working...