Richard,
Use a macro with the Quit action. In the Condition for this action, put
the equivalent of this...
DCount("*","YourTable","[Date]='#Num!'")>0
If you can't see the Condition column in the macro design window, select
it from the View menu.
As an aside, 'Date' is a 'Reserved Word' in Access (i.e. has a special
meaning), and as such it is not a good idea to use this as the name of a
field or control or database object.
Now, you may need to explain your purpose or your problem a little
further. If you are seeing #NUM! in your database, it indicates an
error or corruption. It is not data as such, and will not be searchable
as data would be. So I suspect your question may turn out to not really
help solve the problem.
--
Steve Schapel, Microsoft Access MVP
I need the code for a macro that will try to Find "#Num!" without the quotes,
within a field called 'Date'. If it finds #Num! then Quit the database. If
it doesn't find #Num! then stay in the database.
Can this be done?
Many thanks in advance.