ElseIf DLookup("[LibraryID]", "tblCurrentUser") <> DLookup("[libraryID]", "tblBooks") Then
Without the criteria part, DLookup will stop at the first record where the field is not null (unless I'm wrong about that and it will stop at the first record - period).
Aside from that, the expression posted basically says, if LibraryID in table A minus LibraryID in table B = 0, then do what follows because it's true. If the id's are text, then unless they can be treated as numbers, you're trying to subtract 2 words from each other. If the id's are autonumbers, you shouldn't be trying to do anything with them. If they are numbers, then just compare them instead of doing arithmetic on them.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.