Results 1 to 7 of 7
  1. #1
    jrsitman is offline Novice
    Windows 11 Access 2010 64bit
    Join Date
    Nov 2024
    Posts
    12

    Changing a field to Not Null

    Is it possible or safe to change an existing field that has data to "Not Null"?



    Thanks,

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    You won't be able to do it if there are records with that field Null, but otherwise it's doable.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,285
    Why not just test for Null?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    jrsitman is offline Novice
    Windows 11 Access 2010 64bit
    Join Date
    Nov 2024
    Posts
    12
    To be clear you're stating the field cannot have any empty data. I'll run a query to see how many not null there are

  5. #5
    jrsitman is offline Novice
    Windows 11 Access 2010 64bit
    Join Date
    Nov 2024
    Posts
    12
    I just ran the query and the field has data in every record. So I can change the status to "Not Null" to force them to enter data, correct?

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    I would say so, yes, but I work primarily with SQL Server back ends.

    To WGM's point, I would test for Null, but from a "belt and suspenders" point of view, I will also set the field to not allow nulls when appropriate.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    jrsitman is offline Novice
    Windows 11 Access 2010 64bit
    Join Date
    Nov 2024
    Posts
    12
    Thanks. We don't want any nulls. I'll try it.

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

Similar Threads

  1. Replies: 18
    Last Post: 10-25-2022, 09:47 AM
  2. Replies: 4
    Last Post: 07-22-2021, 04:11 PM
  3. Replies: 3
    Last Post: 06-30-2017, 10:56 AM
  4. Replies: 5
    Last Post: 04-07-2017, 08:55 AM
  5. Replies: 7
    Last Post: 11-07-2016, 09:24 AM

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