If you attempting to use the NotInList event to insert a row into tblCategories where the NewData value is already present in the CategoryName column, then assuming the column is uniquely indexed as it should be, the INSERT operation will fail due to the index violation. If such a row does exist, however, it begs the question of why the event is being triggered in the first place.
BTW, I notice that you are also trying to insert a value into the foreign key column ccnFolderID. This should be possible, but in cases where it is necessary to insert values into columns other than a candidate key I would generally open a little form in dialogue mode to do so. This is illustrated in my NotInList demo in the case of the City combo box control in the frmContacts form. Note, however, that this illustrates the methodology only, as I've ignored the fact that city names, like personal names, can legitimately be duplicated, so the use of the NotInList event procedure is in reality ruled out.
Your acknowledgement that you *'don't have proper knowledge of how to make it work'*is commendably honest. The quote by Richard Feynman below my signature is pertinent. I do think you are trying a little too hard to run before you can walk, and would be well advised to put this application on the back burner for a while so that you can devote some time to gaining a good basic understanding of both the databases relational model, and of the nuts and bolts of MS Access, VBA and SQL. Otherwise you will continue to need nursemaiding at every step. There are quite a few online tutorials which a little bit of googling will throw up, but I still think there is no real substitute to reading the literature, both theoretical and practical.