Databinding DateTimePicker and zeroing results?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kyote

    #1

    Databinding DateTimePicker and zeroing results?

    I'm using a DateTimePicker for date fields in an Access db Membership
    app. Some of the date fields are empty, meaning they haven't been
    filled out yet, or they cannot be. But when a record is read with
    empty fields, their connected DateTimePicker' s display the current
    date.

    Is there any way to have the DateTimePicker show as empty/blank?
    ---
    Kyote
  • Michel Posseth [MCP]

    #2
    Re: Databinding DateTimePicker and zeroing results?



    You might investigate my date entry control

    wich can handle db nulls and show a empty box and lots and loots more (
    investigate the property`s of the control )



    i wrote this control for the company i work for , for simple date entry
    while still providing data binding ( the controls takes any entry that is
    valid for cdate , 1-1 , 1 jan etc etc etc )
    it comes with a sample project and full sourcecode.

    regards

    Michel Posseth





    "Kyote" <kyote_love@nos pamhotmail.coms chreef in bericht
    news:cucp33dofg rgl35ha8tsb3js6 jok2f7hmf@4ax.c om...
    I'm using a DateTimePicker for date fields in an Access db Membership
    app. Some of the date fields are empty, meaning they haven't been
    filled out yet, or they cannot be. But when a record is read with
    empty fields, their connected DateTimePicker' s display the current
    date.
    >
    Is there any way to have the DateTimePicker show as empty/blank?
    ---
    Kyote

    Comment

    • D2

      #3
      Re: Databinding DateTimePicker and zeroing results?

      On May 5, 9:47 pm, Kyote <kyote_l...@nos pamhotmail.comw rote:
      I'm using a DateTimePicker for date fields in an Access db Membership
      app. Some of the date fields are empty, meaning they haven't been
      filled out yet, or they cannot be. But when a record is read with
      empty fields, their connected DateTimePicker' s display the current
      date.
      >
      Is there any way to have the DateTimePicker show as empty/blank?
      ---
      Kyote
      While binding the control; you can handle the Parse and Format events
      of the binding object. In your event handlers, your can set a
      different value(default value when database has null). Right now i
      dont have the sample code, you can find good samples at msdn.

      Comment

      • Michel Posseth [MCP]

        #4
        Re: Databinding DateTimePicker and zeroing results?


        Yes ,,

        But afaik you can`t set the control to a empty value when the db value
        is a dbnull


        "D2" <dhapola@yahoo. comschreef in bericht
        news:1178434700 .377663.192590@ y5g2000hsa.goog legroups.com...
        On May 5, 9:47 pm, Kyote <kyote_l...@nos pamhotmail.comw rote:
        >I'm using a DateTimePicker for date fields in an Access db Membership
        >app. Some of the date fields are empty, meaning they haven't been
        >filled out yet, or they cannot be. But when a record is read with
        >empty fields, their connected DateTimePicker' s display the current
        >date.
        >>
        >Is there any way to have the DateTimePicker show as empty/blank?
        >---
        >Kyote
        >
        While binding the control; you can handle the Parse and Format events
        of the binding object. In your event handlers, your can set a
        different value(default value when database has null). Right now i
        dont have the sample code, you can find good samples at msdn.
        >

        Comment

        • D2

          #5
          Re: Databinding DateTimePicker and zeroing results?

          On May 6, 12:46 pm, "Michel Posseth [MCP]" <msn...@posseth .comwrote:
          Yes ,,
          >
          But afaik you can`t set the control to a empty value when the db value
          is a dbnull
          >
          "D2" <dhap...@yahoo. comschreef in berichtnews:117 8434700.377663. 192590@y5g2000h sa.googlegroups .com...
          >
          On May 5, 9:47 pm, Kyote <kyote_l...@nos pamhotmail.comw rote:
          I'm using a DateTimePicker for date fields in an Access db Membership
          app. Some of the date fields are empty, meaning they haven't been
          filled out yet, or they cannot be. But when a record is read with
          empty fields, their connected DateTimePicker' s display the current
          date.
          >
          Is there any way to have the DateTimePicker show as empty/blank?
          ---
          Kyote
          >
          While binding the control; you can handle the Parse and Format events
          of the binding object. In your event handlers, your can set a
          different value(default value when database has null). Right now i
          dont have the sample code, you can find good samples at msdn.
          correct! we usually set a default date/time for display... again when
          saving back, check whether user has changed it or not.. if no then we
          set null in the db.

          Comment

          • Kyote

            #6
            Re: Databinding DateTimePicker and zeroing results?

            On Sat, 5 May 2007 21:30:44 +0200, "Michel Posseth [MCP]"
            <msnews@posseth .comwrote:
            >
            >
            >You might investigate my date entry control
            >
            >wich can handle db nulls and show a empty box and lots and loots more (
            >investigate the property`s of the control )
            >
            >http://www.vbdotnetcoder.com/Downloa.../dateentry.zip
            >
            >i wrote this control for the company i work for , for simple date entry
            >while still providing data binding ( the controls takes any entry that is
            >valid for cdate , 1-1 , 1 jan etc etc etc )
            it comes with a sample project and full sourcecode.
            Thank you Michael. I just downloaded it and will look at the sample
            project in a few minutes. From your reply to D2 I think you understand
            exactly what I'm trying to do and that this will indeed solve my
            problems.
            >
            >regards
            >
            >Michel Posseth

            ---
            Kyote

            Comment

            • Jay Parzych

              #7
              Re: Databinding DateTimePicker and zeroing results?

              On May 6, 12:46 pm, "Michel Posseth [MCP]" <msn...@posseth .comwrote:
              >
              >Yes ,,
              >>
              >But afaik you can`t set the control to a empty value when the db
              >value is a dbnull
              >>
              >"D2" <dhap...@yahoo. comschreef in
              >berichtnews:11 78434700.377663 .192590@y5g2000 hsa.googlegroup s.com...
              >>
              >>On May 5, 9:47 pm, Kyote <kyote_l...@nos pamhotmail.comw rote:
              >>>
              >>>I'm using a DateTimePicker for date fields in an Access db
              >>>Membership app. Some of the date fields are empty, meaning they
              >>>haven't been filled out yet, or they cannot be. But when a record
              >>>is read with empty fields, their connected DateTimePicker' s display
              >>>the current date.
              >>>>
              >>>Is there any way to have the DateTimePicker show as empty/blank?
              >>>---
              >>>Kyote
              >>While binding the control; you can handle the Parse and Format
              >>events of the binding object. In your event handlers, your can set a
              >>different value(default value when database has null). Right now i
              >>dont have the sample code, you can find good samples at msdn.
              >>>
              correct! we usually set a default date/time for display... again when
              saving back, check whether user has changed it or not.. if no then we
              set null in the db.
              >
              this works:



              you can customize your null value. for example, i have lots of time columns
              that are set later. if null, they say Click To Set. in the click event,
              i set the value to the current time.


              Comment

              Working...