Perhaps because you have have ASP in ASP in this line...
Code:
Response.Write "<INPUT type=""hidden"" name=""InquiryNumber"" value=<%=(oRS.Fields.Item("ID").Value + 1000)%> >" & vbcrlf
You are writing in ASP since you are using Response.Write, but you also use the '<% %>' pair to write some value.
Hope it is this, so you can go on
Jacob.