بررسی جدول که در حالت ویرایش هست یا خیر

if users.State =dsEdit then