DTPicker problem.. need help here

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • squrel
    New Member
    • Jan 2008
    • 143

    DTPicker problem.. need help here

    Hello everyone..

    I need some help here... i m using VB6 and SQLServer2000.. . i have forms regarding some cases in courts and in my form i have two DTPicker called as Entrydate and Closedate... these 2 are invisible to the user bt the things is when a user create a new case in a system automatically the date has to be created as a current date by default in DTPentrydate and when the user close the case the date has to be closed automatically as a current date by default..
    i have no idea wht i have to do?
    wld u plz help me
    thank u very much
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Then you do not need the controls at all. You need to use system date.

    Comment

    • squrel
      New Member
      • Jan 2008
      • 143

      #3
      i m using the system date.. i have already set the system date wit tht.. the thing i dont knw how to do set the date when the case gets open and how to set the date when the case get closed and tht also has to be automatically.. tht i dont knw... already the date is set as default bt both the date comes same as the current date by default..
      can u help me with the code.. i have no idea
      thankx

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        is it such that your case open date and case close date are one and same ?

        Comment

        • squrel
          New Member
          • Jan 2008
          • 143

          #5
          now is coming the same bt i dont want them same... coz may be the case is open month or more and after tht it wil get closed...
          how can i set the dtpentrydate and dtpclosedate to the opening a case and closing a case...
          plz help me in tht

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            1.when you open a case accept the system date as opening date.

            2.do the same for closing date also.

            in that way you do not need the DTPicker controls.

            Comment

            • squrel
              New Member
              • Jan 2008
              • 143

              #7
              i have to column in my casemaster table as entry date and closedate...
              so when they come to the add mode to add a new case to the system i have to accept the date thr.. this is wht u mean... rit???
              can u help me wit the code sample plz

              Comment

              • squrel
                New Member
                • Jan 2008
                • 143

                #8
                i have this code in my add mode

                DTPentrydt.Valu e = Date
                DTPclosedt.Valu e = Date

                bt both the date is coming same
                how can i chage this and set them to the opening the case and closing the case date??

                Comment

                • debasisdas
                  Recognized Expert Expert
                  • Dec 2006
                  • 8119

                  #9
                  are you opening and closing the mcase on the same form ?

                  how can you enter the closing date at the time of opening the case ?

                  Comment

                  • squrel
                    New Member
                    • Jan 2008
                    • 143

                    #10
                    ya opening and closing on the same form... actually in the beginning they suppose to enter the date for the entering and closing date and thts why i used the dtpicker for tht.. bt then they said tht has to be invisible to the user and make it system date.. for opening i can do it in the add mode and enter the system date as a default when the add the new case.. bt for closing date i dont knw wht should i do... and u r telling me not to use dtpicker and i dont knw wht to use instead of tht and how to use..

                    Comment

                    • debasisdas
                      Recognized Expert Expert
                      • Dec 2006
                      • 8119

                      #11
                      can you tell me what is the logic to decide the closing date ?

                      how you know when the case will be closed ? is that pre-decided ?

                      any link with opening date ?

                      Comment

                      • squrel
                        New Member
                        • Jan 2008
                        • 143

                        #12
                        this is abt some cases in the court and never can be pre-decided when the case get closed.. coz it may take one day to get close or one month to get close... thts why i have no idea how to do for the closing date... i have to set something for a closing date of the case.... thr r 2 columns on my master table as entry and close date and tht i m showing in the grid on the form... when the add the case the entry wil get the current date and wil enter to the grid bt the close date wil be empty... bt when the got the result from the court and the case get closed the problem comes.. coz i dont knw how to put tht date in the database and the gird both..
                        i hope u understand wht i mean :)

                        Comment

                        • debasisdas
                          Recognized Expert Expert
                          • Dec 2006
                          • 8119

                          #13
                          the following might help you

                          1.at the time of opening a case enter only the opening day (closing date as null).
                          2.use a separate form to close all the open cases (accept the system date here as closing date).
                          3.at the time of closing update the table with closing date.

                          Comment

                          • squrel
                            New Member
                            • Jan 2008
                            • 143

                            #14
                            ok.. tht is very good idea i can do tht...
                            bt can i make a button as a final on the same form and by clicking on the button the case gets close and set the close date in the button?? if i want to do tht can i put this line in the click event of the button

                            DTPclosedt.Valu e = Date

                            and wht shld i put as an update of my gird in the click event of button???
                            sorry for troubling u

                            Comment

                            • debasisdas
                              Recognized Expert Expert
                              • Dec 2006
                              • 8119

                              #15
                              it is always better to close the cases on a separate form.
                              you need to update the close date in the database table not the grid, after that you can refresh the recordset that is populating the grid to display the changed records with cloging date.

                              Comment

                              Working...