Hi I am trying to add some new records to a table via an input form. I do however want a message to pop up if the record does not already exit in the table and then not to add it.
I have this until now:
If IsNull(DLookup([(SE)_tbl_List_Strategies].[strategy], [(SE)_tbl_List_Strategies], "x")) Then
MsgBox "this strategy does not exist"
it comes up with the follwoing error message:
runtime error 2465
cannot find the field "/" referred to in your expression.
There are so many issues with you code I don't know where to begin.
However, the Domain Functions (DLookup,DCount etc) require strings are there arguments, and, on the basis that you are checking for a unique record, I would use DCount() because then there is no 'Null" issue (ie it allways returns an integer, zero if not found).
Also, do you realy have brackets in you table name !!??
On the basis that you do, and the Unique field (PK?) is the Strategy field and x is a variable or control on your form, then try something like this
DCount("strategy", "(SE)_tbl_List_Strategies", "strategy = '" & x & "'")
I have assumed strategy is a Text field, but if it is a number then try this