How can I erase" the contents of a field?

Results 1 to 3 of 3

Thread: How can I erase" the contents of a field?

  1. #1
    Mark Maslar Guest

    Default How can I erase" the contents of a field?

    There&#039s probably an easy answer to this, but I just can&#039t figure it out: How can I "erase" the contents of a database&#039s field programatically? <BR><BR>The field is defined as a string. (At the moment, it&#039s an Access 97 database, but that shouldn&#039t matter.)<BR>Writing a null to the field, IE: RS(3) = vbNullChar is not the same as going into MS Access and deleting the field&#039s contents. I need a way to programatically produce the latter effect. Deleting the contents in Access causes the following test to pass; setting the field to vbNullChar does not!<BR><BR> if isnull(RS(3).value) then<BR> &#039do something<BR> end if<BR><BR>BACKGROUND, FYI: I have a form with some required fields and some optional fields. If the user leaves an optional field blank, I don&#039t attempt to write it to the database because writing a null string would cause an error. However, there are situations where the user initially fills in the optional fields & submits. Later, they might edit their record and decide to leave some optional fields blank.<BR><BR>Thanks in advance,<BR>Mark Maslar<BR>

  2. #2
    Neil Popham Guest

    Default RE: How can I erase

    im SURE i&#039ve previously used<BR><BR>"... SET Field1=Null, Field2=..."<BR><BR>in an SQL statement and it can be queried as such.<BR><BR>similarly<BR><BR>objRec("Field1") = Null<BR><BR><BR>are you certain this does not work?

  3. #3
    Mark Maslar Guest

    Default RE: How can I erase

    &#062; objRec("Field1") = Null<BR>&#062; are you certain this does not work?<BR><BR>I was setting it to vbNullChar or Chr(0). They didn&#039t work, but Null does. ARRGH!!!<BR><BR>Thanks :-)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts