Results 1 to 2 of 2
  1. #1
    DanT is offline Novice
    Windows 11 Office 365
    Join Date
    Sep 2022
    Posts
    23

    Deleting field value causes error before an attempt to save the record

    Hi there, I'm working on database with MS SQL Server as back end. I have a form based on table with restriction for 'not blank' in some fields on back end side, and there's a problem when editing or adding a new record. If a field is blank I can easily tab through the form, same as if it's not blank. However, after deleting content I cannot skip to another field before putting anything back to it, and there's an error popping out:

    'You tried to assign the NULL value to a variable that is not a Variant data type'

    I have BEFORE UPDATE macro that checks all the fields for this very purpose, but this error happens way before I even attempt to save the record.



    I played with if statement found in this post.I tried to put it through macro editor as well as VBA editor, placing it on both form and particular field properties (on dirty, on change, before update, on lost focus) unfortunately with no luck.

    Does anyone know how to get rid of this error please?

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    Don’t set the ‘not blank’ property in the table, control it with your form? Before update event

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 09-25-2018, 05:33 PM
  2. Replies: 5
    Last Post: 05-15-2015, 10:49 AM
  3. Replies: 2
    Last Post: 01-05-2012, 04:23 AM
  4. Replies: 0
    Last Post: 09-01-2009, 12:33 PM
  5. Error when deleting a record
    By access in forum Forms
    Replies: 5
    Last Post: 06-15-2009, 12:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums