Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2009

    Question Unanswered: Can't assign a zero to a null field???

    I have a number field. When I try to add something to it does work under when adding the record I put a zero in the number field. I now have zero as default when adding.
    I've tried if field =null then field=0
    but I get no erros but the field is still a null value.

  2. #2
    Join Date
    Mar 2007
    What are you doing to add to that field? Are you using code? If so then post the code you are using so we can see it.
    RuralGuy (RG for short) aka Allan Bunch MS Access MVP - acXP, ac07, ac10 - WinXP Pro, Win7 Pro
    Please reply to this forum so all may learn.

  3. #3
    Join Date
    Jul 2009
    I'll post more details as soon as I get more time, probably Monday. The solution has been to default the field to zero but I need to better understand the cause of the problem as my solution is a poor work around that should not be needed.

    I was hoping for a answer without having to spend more time on it as time is very short these days.

  4. #4
    Join Date
    Apr 2002
    Toronto, Canada
    Quote Originally Posted by Bob2119
    I've tried if field =null
    try field IS NULL instead | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Mar 2009
    Provided Answers: 15
    field IS NULL
    is pure SQL (if I may say so), in Access VBA try
    If IsNull(field.Value) Then
    Have a nice day!

Posting Permissions

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