How to add blank date to recordset??


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: How to add blank date to recordset??

Hybrid View

  1. #1
    Mark Burns Guest

    How to add blank date to recordset??


    How do I add a date to a recordset? My app is user interface to an access
    db which loads records from the database. But if user wants to add records
    I am having problems with adding to date fields. I would like to add a blank
    record but using the addNew method as below I seem to have to add a value.

    This is how I have been adding records. Is there any way to do this with
    the = expression??

    recordset.AddNew

    recordset!Date = "4/4/44"

    recordset.Update

    I can get away with (= "") for textfields, but for dates it seems I have
    to add a real date.
    Any help would be greatly appreciated
    Mark Burns

  2. #2
    Mark Burns Guest

    Re: How to add blank date to recordset??


    Nevermind, I thought I had tried to AddNew without specifying the individual
    fields before and it didn't work, but I guess not. If I don't specify the
    fields then each record not specified is blank

    Mark

  3. #3
    Arthur Wood Guest

    Re: How to add blank date to recordset??


    Mark,

    In addition, when you do supply dates, you sould either use the CDate
    function, or delimit the date values with #s:

    rs!DateField = "#4/4/01#"

    the # is the H+Jet dlimiter for Date values.

    Arthur Wood


    "Mark Burns" <mburns@slip.net> wrote:
    >
    >Nevermind, I thought I had tried to AddNew without specifying the individual
    >fields before and it didn't work, but I guess not. If I don't specify the
    >fields then each record not specified is blank
    >
    >Mark



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center