Data access and dates (simple question?!)


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Data access and dates (simple question?!)

Hybrid View

  1. #1
    Neil Martin Guest

    Data access and dates (simple question?!)


    I'm tearing my hair out over what I thought was such an easy thing to do!
    I'm using VB6 and the Data control. I have a number of text boxes linked
    to Data/Time fields. I would like to be able to delete dates and leave these
    text boxes empty but I either get 'Data Conversion error' type messages or
    no message and no changes are saved. The problem is that Date/Time fields
    cannot be zero length strings but should be either dates or NULL. I can't
    set the text boxes to NULL and if I use Edit/Update it retriggers the Validate
    function (which I don't want). If I set the text box CauseValidation event
    to False it doesn't make any difference (a MS bug methinks). How can I delete
    text boxes containing dates (linked to Date/Time data type) to leave them
    blank?

    Thanks in anticipation.

    Neil

    ps Am I being stupid by missing the obvious here?


  2. #2
    nin Guest

    Re: Data access and dates (simple question?!)


    I have the same exact problem. I tried making my own method where on textbox_change,
    it checks if the textbox.text="". If it is, i did textbox.text = null, but
    sadly, that didnt do it. It wont except null.
    Also, did you run into this problem... in access, you set the format to currency,
    and thru vb, the textbox doesnt display the format, but just as a regular
    number. anyways, if i get a solution to the above problem, ill be sure to
    let you know.

    sal

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