Here's the code..
<% if request.form("btnProceed") = "Proceed" then
nNbrOfDays = request.form("txtNbrOfDays") %>
<input type="hidden" name="hdnNbrOfDays" value="<%=nNbrOfDays%>">
<% for i = 1 to nNbrOfDays %>
<table cellspacing="0" cellpadding="2" border="0" width>
<tr>
<td class="fld_input_top" width="175">Day <%=i%> <input type="text" name="txtDate<%=i%>" value style="width:80">
<img src="images/calendar.gif" WIDTH="16" HEIGHT="16"></td>
<td class="fld_input_top" width="125">
<select name="cboService<%=i%>" style="width:120">
<option value="0">No Service</option>
<option value="1">Daily Visits</option>
<option value="2">Live-In</option>
</select>
</td>
<td class="fld_input_top" width="150">
<select name="cboVisits<%=i%>" style="width:120">
<option value="0">No Visit</option>
<option value="1">One Visit</option>
<option value="2">Two Visits</option>
<option value="3">Three Visits</option>
<option value="4">Four Visits</option>
</select>
</td>
</tr>
</table>
<br><br>
<% next %>
<input type="submit" name="btnProceed2" value="Show Visit Details">
<br>
<% end if
if request.form("btnProceed2") <> "" then
nNbrOfDays = Request.Form("hdnNbrOfDays")
for i = 1 to nNbrOfDays %>
<table cellspacing="0" cellpadding="2" border="0" width>
<tr>
<td class="fld_input" colspan="4"><font style="color:#0272B6; font-weight:bold">Day Number <%=i%> Date: <%=Request.Form("txtDate" & cint(i))%></font></td>
</tr>
<% for k = 1 to request.form("cboVisits" & cint(i)) %>
<tr>
<td class="fld_input" width="25"> </td>
<td class="fld_input" colspan="3"><b>Visit <%=k%></b></td>
</tr>
<tr>
<td width="25"> </td>
<td width="25"> </td>
<td class="fld_input" width="100">Time of Visit: </td>
<td class="fld_input" width="100">
<select name="cboTime<%=i%>_<%=k%>" style="width:150">
<option value="1">8:00am</option>
</select>
</td>
</tr>
<tr>
<td width="25"> </td>
<td width="25"> </td>
<td class="fld_input">Petsitter: </td>
<td class="fld_input">
<select name="cboPetsitter<%=i%>_<%=k%>" style="width:150">
<option value="1">Petsitter</option>
</select>
</td>
</tr>
<tr>
<td width="25"> </td>
<td width="25"> </td>
<td class="fld_input">Fee: $ </td>
<td class="fld_input"><input type="text" name="txtFee<%=i%>_<%=k%>" value style="width:150"></td>
</tr>
<% next %>
</table>
<input type="hidden" name="hdnDate<%=i%>" value="<%=Request.Form("txtDate" & cint(i))%>">
<input type="hidden" name="hdnService<%=i%>" value="<%=Request.Form("cboService" & cint(i))%>">
<input type="hidden" name="hdnVisits<%=i%>" value="<%=Request.Form("cboVisits" & cint(i))%>">
<input type="hidden" name="hdnNbrOfDays2" value="<%=nNbrOfDays%>">
<br>
<% next
end if
if Request.Form("btnSubmit") = "Submit" then
nDayNbr = cint(0)
for i = 1 to nNbrOfDays
nLastDayKey = 1
nNewDayKey = cint(nLastDayKey) + 1
nDayNumber = nDayNumber + 1
sDate = fnSubstitute(Request.Form("hdnDate" & cint(i)))
nNbrOfVisits = Request.Form("hdnVisits" & cint(i))
nXrefService = Request.Form("hdnService" & cint(i))
sql_days = "insert into tblReservationDays ....."
objConn.execute sql_days
next
for i = 1 to nNbrOfDays
nDayNbr = i
'Response.Write "Day Number " & nDayNbr & "<br>"
for k = 1 to nNbrOfVisits
nLastVisitKey = 1
nNewVisitKey = cint(nLastVisitKey) + 1
nVisitNbr = k
nVisitTime = Request.Form("cboTime" & cstr(i) & "_" & cstr(k))
nVisitSitter = Request.Form("cboPetsitter" & cstr(i) & "_" & cstr(k))
nVisitFee = Request.Form("txtFee" & cstr(i) & "_" & cstr(k))
'Response.Write "Visit Number " & nVisitNbr & "<br>"
'Response.Write "nVisitTime " & nVisitTime & "<br>"
'Response.Write "nVisitSitter " & nVisitSitter & "<br>"
'Response.Write "nVisitFee " & nVisitFee & "<br><br>"
'Response.End
sql_visit = "insert into tblReservationVisits (intVisitKey, intXrefDay, strTime, intXrefPetsitter, " & _
" nbrVisitFee, intVisitNbr, intXrefReservation, strLastModified) " & _
" values (" & nNewVisitKey & "," & nDayNbr & "," & nVisitTime & "," & nVisitPetsitter & "," & _
nVisitFee & "," & nVisitNbr & "," & nNewResNbr & "," & sDateString & ")"
'response.write sql_visit & "<br><br>"
'response.end
objConn.execute sql_visit
next
next
if err.number <> 0 then
Response.write "Error with sql_visit: = " & sql_visit & "-" & err.description
end if
end if
%>