Results 1 to 3 of 3
  1. #1
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496

    Added field for new option group results in null error

    To an existing table, I added a new integer field to capture the user’s choice for a related new option group on a subForm
    Existing records in the table are understandably null for this value (seems to be correct -yes?). The default is 0 for new records.
    When it and it’s parent form opens, some formatting occurs that is based on the value of the option group. Consequently, the null value is causing error.

    I could cycle through all the records and assign a value to the field when the field is created (on each of the many parallel back end tables.
    or
    I could assign a value to the field in the forms OnCurrent event (if null)
    or
    I could Nz() throughout the code (although a null would make no sense to the user)

    Is their a best practice on this?

    Thnx in advance,
    m.

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    I'd use an Update query to set them all to zero.?

  3. #3
    markjkubicki's Avatar
    markjkubicki is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Jul 2010
    Location
    Fire Island Pines, NY
    Posts
    496
    thnx
    ...works for me

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

Similar Threads

  1. Replies: 14
    Last Post: 06-25-2020, 08:42 AM
  2. Replies: 4
    Last Post: 10-03-2014, 06:36 AM
  3. Replies: 7
    Last Post: 09-21-2012, 03:30 PM
  4. Replies: 6
    Last Post: 07-20-2011, 11:54 AM
  5. Replies: 2
    Last Post: 01-31-2011, 05:17 PM

Tags for this Thread

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