Results 1 to 4 of 4
  1. #1
    tsgtnissen is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Sep 2014
    Posts
    28

    Question Query Critera - IsNull - Not working

    Background :



    I have a query thatlooks at all the records in “EventsLog” table. I have a field [UserID] in thattable that shows who the Event is assigned too. When I delete a User it leavestheir assigned events in “EventsLog” but the [UserID] is blank.

    I want to make aquery that finds any Event with a blank UserID so I can delete them.

    The problem I think is something to do with blank vs null.


    SUPER bonus - is there a way to make a button that deletes all "Events" with a Null/Blank [UserID]?


    Setup:



    Click image for larger version. 

Name:	i2.PNG 
Views:	10 
Size:	10.9 KB 
ID:	42964
    Click image for larger version. 

Name:	i3.PNG 
Views:	10 
Size:	35.8 KB 
ID:	42965
    Attached Thumbnails Attached Thumbnails i1.PNG  

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    If you change the relationship between the two tables so that it enforces referential integrity, related records will be deleted as the same time.

    That said, it might be better NOT to delete records but mark those as no longer "Required".
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    tsgtnissen is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Sep 2014
    Posts
    28
    That worked!

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by tsgtnissen View Post
    That worked!
    Ah! Good. That what we like to hear. Another satisfied customer
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. How to use if in query critera
    By ali_sh in forum Access
    Replies: 5
    Last Post: 11-05-2019, 12:34 PM
  2. VBA code for "Not IsNull" is not working
    By Xarkath in forum Access
    Replies: 11
    Last Post: 09-02-2014, 12:05 PM
  3. Query Critera w/ two Paths
    By Mike4172 in forum Queries
    Replies: 6
    Last Post: 04-10-2013, 08:47 PM
  4. IsNull not working
    By vbjohn in forum Access
    Replies: 19
    Last Post: 02-29-2012, 02:21 PM
  5. IsNull not working...
    By Moekandu in forum Programming
    Replies: 3
    Last Post: 01-29-2011, 06:48 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