Secondly, in my database i am having two fields,
[Application ID] as autonumber type and [Form No] as Text
data type. In lost focus of [Form No] in my form I am
writing a code which will check the [Form No] is already
existed in my database, whose year also same. If it exists
then it will cancel the event and go to that particular
record for further modification of the record.
Further to what Jeff says, it's not clear why you have an autonumber column
in this table at all. If the combination (FormNo, YearNumber) is unique,
which seems to be what this paragraph says, then why not simply use that as
the PK? What extra do you get from using a AN -- other than, as you have
discovered, the disappointment that ANs don't do what you want them to?
As a second point, it might be helpful to give your users some method of
picking the YearNumber and FormNo[1] before starting to enter new data, so
that they don't have to throw it away when it transpires that it's already
there.
Hope that helps
Tim F
[1] PS: please don't use spaces in object names for tables or fields:
although it's legal in Access at the moment, it creates lots of problems
and will get you back later...