Results 1 to 2 of 2

Thread: Saving Null fields in ADO/VB/ACCESS

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    London
    Posts
    290

    Post

    Hi!

    I have a little problem...

    When reading data from a record, and putting it into control
    properties, i was using :

    frmWhatever.TxtWhatever = !FieldToRead

    which worked fine. However, when FieldToRead was a blank field, i got an error. The solution was :

    frmWhatever.TxtWhatever = "" & !FieldToRead


    I now have the same problem saving data. The following is fine when theres data present, but not otherwise:

    !FieldToWrite = "" & frmWhatever.TxtWhatever

    the "" & fix doesnt work here (I also tried not using it - same result).

    What should i do? I`m really looking to avoid an IF...THEN case for each field i write.

    Any ideas?

    Thanks,
    Alex.


  2. #2
    Lively Member
    Join Date
    Jan 2000
    Location
    Springfield, IL
    Posts
    124

    Post

    You can try this:
    Code:
    !FieldToWrite = IIF(frmWhatever.TxtWhatever<>"",frmWhatever.TxtWhatever,vbNull)

Posting Permissions

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



Click Here to Expand Forum to Full Width