Blank date

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

    #1

    Blank date

    I am trying to add records to a table with a date field (access-database)
    where some of the records have a date and some haven't.
    I use
    dim dteReturDate as Date
    If IsDate(RsMem("R eturdato").Valu e) Then
    dteReturdato = RsMem("Returdat o").Value
    Else
    dteReturdato = Null
    End If
    ..addnew
    RsMem2.AddNew
    RsMem2!Returdat o = dteReturdato
    ..Update

    Problem is the Null and the debugging stops at the RsMem2!Returdat o-line
    regards
    reidarT


  • Cor Ligthert [MVP]

    #2
    Re: Blank date

    Reidar,

    This is an adodb question.

    There is a small however active newsgroups where at least Paul and Bill are
    forever answering on this kind of questions (They both are VB.Net)

    microsoft.publi c.dotnet.langua ges.vb.data

    (Bill is not active in this newsgroup and I did not see Paul for a while, I
    don't know if he lives in the south of the US.)

    I hope this helps,

    Cor


    Comment

    • Ken Tucker [MVP]

      #3
      Re: Blank date

      Hi,

      Dim null As Object = Convert.DBNull



      Ken

      ------------------------

      "ReidarT" <reidar@eivon.n o> wrote in message
      news:OA15xoRtFH A.3040@TK2MSFTN GP14.phx.gbl...[color=blue]
      >I am trying to add records to a table with a date field (access-database)
      >where some of the records have a date and some haven't.
      > I use
      > dim dteReturDate as Date
      > If IsDate(RsMem("R eturdato").Valu e) Then
      > dteReturdato = RsMem("Returdat o").Value
      > Else
      > dteReturdato = Null
      > End If
      > .addnew
      > RsMem2.AddNew
      > RsMem2!Returdat o = dteReturdato
      > .Update
      >
      > Problem is the Null and the debugging stops at the RsMem2!Returdat o-line
      > regards
      > reidarT
      >[/color]


      Comment

      Working...