Select field - How can use a query in right way?

Hello,
I got a ID field and I’m using select data type as usual.
The issue is that ID has to be every time new and not present in previous registration.
I did a kind of query that works but when I navigate to previous existent record the ID disappears because the query feels it as present… A bit strange behavior because once entered it would show the content without applying the query.
This is what I’m using:
SELECT ID, code
FROM container
WHERE contType = 3 AND NOT EXISTS (SELECT ID FROM trackable_mov_container3 WHERE trackable_mov_container3.container_id3 = container.ID)
ORDER BY code

I hope it’s clear.

Hi
First, activate the debugging options of the form to check if any errors occurred during this event.
Do you see any error or message?

Hi, no error.
Now I’m trying to use NOT IN instead of NOT EXISTS but I have to test