you use square brackets when table and field names have spaces or none alphanumeric character in them or they are reserved words.
you use the double quotes to create strings, which is the datatype the dcount etc accepts for its parameters
you use single quotes to define a string within a string
so your code will look something like this if item_code is a number
Code:
if dcount("item_code","tble_itemlisting","item_code=" & me.text221)<>0 then
msgbox "some message here"
end if
of item_code is text then you need a string within a string, so your code would be
Code:
if dcount("item_code","tble_itemlisting","item_code='" & me.text221 & "'")<>0 then
msgbox "some message here"
end if
suggest you get into the habit of giving your control names meaningful names. It will significantly reduce the chance of errors and make your code more readable