I am trying to construct an if statement which will perform a function on a string if that string does not does not already exist in a table, so that duplicates can are avoided. I am using the code:
- [ID] is the field to check
- 'testtable' is the table
- IDtest is the string which should not match [ID]
The idea is that Dlookup checks to see if there is already an instance of IDtest in the table, but the code is not working. Can anyone find fault in the code or have any other sugestions?
Cheers
Code:
If IsNull(DLookup("[ID]", "testtable", [ID] = IDtest))
- [ID] is the field to check
- 'testtable' is the table
- IDtest is the string which should not match [ID]
The idea is that Dlookup checks to see if there is already an instance of IDtest in the table, but the code is not working. Can anyone find fault in the code or have any other sugestions?
Cheers