I have code in an ASP page to insert some data, I want to insert into one table, retrieve the primary key from that entry and then insert that into another table. Here is what I have so far and I am getting type mismatch when trying to insert into the second table:
conn.Execute "insert into tblOne (AName) values ('" & Request.Form("BName"
& "')"
set ANum = Conn.Execute("SELECT MAX(recordID) FROM tblOne"
conn.Execute "insert into tblTwo (tblOneNum) values (" & ANum & "
"
I know I must be doing something wrong, but don't know what.
Thanks
conn.Execute "insert into tblOne (AName) values ('" & Request.Form("BName"

set ANum = Conn.Execute("SELECT MAX(recordID) FROM tblOne"

conn.Execute "insert into tblTwo (tblOneNum) values (" & ANum & "

I know I must be doing something wrong, but don't know what.
Thanks