if your using adodb try this
set rs as new adodb.recordset
rs.open "Select * from table1 where emp_id='" & textid.text & "'", cn, 3, 3
if rs.recourdcount > 0 then
rs.open "insert into table1 (id, month, year) value ('" + textid.text + "','" + textmonth.text + "','" + textyear.text + "')", cn, 3, 3
end if
set rs = nothing
the cn there is your adodb.connection
if your using adodc just change the adodb to adodc, adodb to data1 if your using DAO. .
Regards,
Ryan Riel