file checkin and checkout

file checkin and checkout

hi everyone.
i hava a problum. i have list.  in that i have a file. i checkout that file(download). when i checking in the same file should be checkin. otherwise it should give error message.
i have one query.
attachment.filename<> attachmentedit..list.current.attachment.filename

where i did the mistake.
plese tell me otherwise please upload sample.

sattibabu vatti

when i checking in for  first record  ,it  is checking in.  it  fail the condition from second record onwords,.
can any bady help me.

sattibabu vatti.