You need to add in the Form field each time you use the OR function, as without specifying it, the statement does not know what it is evaluating against, hence the error message. i.e.
If Forms![OrderProc].DelPostCode Like “BT*” Or Forms![OrderProc].DelPostCode Like “HS*” Then….
That will look very untidy if you add in 20 or statements. Possibly a better solution would be to hold the warning postcodes in a table, then read in the field and compare to each of the records in the DB e.g.
in_pc = Forms![OrderProc].DelPostCode
set recordset here
warn_pc = “select pc from warn_pc where pc = instr(in_pc,1,2)”
open recordset etc etc
if the recordset returns something, then send the warning message, if not, then just leave alone…
Let us know if you need help with the recordsets.
You could also setup a Select/Case group
dim chkPostCode as string
chkPostCode = subst(Forms![OrderProc].DelPostCode, 1, 2)
Case “BT”, “HS”, ……..
your code to display message box here
It just looks a little cleaner to me.