You do not need to loop through your records, since you will only be returning 1 record. Therefore check for a record, and if it exists assign it to a variable. If not return a 0 like so:
One point to remember is ALWAYS check what the user has entered into the textbox before inserting into your database. This will prevent SQL Injection attacks.
Set objRS = Server.CreateObject("ADODB.Recordset")
Set objRS.ActiveConnection = objConn
strQ = "SELECT Count(Zipcodes.Zipcode) AS Zipcode FROM Zipcodes where zipcode = '" & strZipcode & "' "
If objRS.EOF = false then
'we found a match
zipcode_count = objRS("Zipcode")
zipcode_count = 0
Set objRS = Nothing
Set objConn = Nothing
<table border="1" cellspacing="1" width="10%">
<td width="75%" align="center"><b><font size="2"># of Records that match</font></b></td>
<td width="25%"><%=zipcode_count%> </td>
You can read more about SQL Injection attacks here:
strZipcode = REPLACE(Request.Form("ZipBox"), "'", "''")
I would also recommend, depending on what type of zipcodes you plan on accepting, check to make sure it's an integer, and limit the size of the textbox.
Your INSERT statment will only execute when the user has submitted your form. Therefore if they do not submit the form, it will not execute and the INSERT statement will not run.
What exact problem are you having with the INSERT statement?