I am attempting to create a form which allows multiple record inserts. This
will be used to add classes by participant to a training database. The page is
created with a repeating region - a checkbox to indicate attendance and hidden
fields with the class name and date.

I would like it to create a unique record for each person (indicated by the
checkbox). I can find no documentation for this anywhere and have attempted to
alter the "multiple update form documentation" for the use of inserting. That
has not worked.

Some code is attached. I have asp fields within the form that create a unique
number for each repeated item and then counts the total number of records.

Any help would be very appreciated!

<%If Request.Form("Submit").Count > 0 Then
Dim iCount, iLoop, varUsername, varDate, varClassName
icount = Request("fldAdd").Count 'iCount is number of records to be updated


set cmdInsert = Server.CreateObject("ADODB.Command")
cmdInsert.ActiveConnection = MM_connDirectorySQL_STRING

For iLoop = 1 to iCount
if(Request.Form(iLoop & ".fldAdd") <> "") Then
if(Request.Form(iLoop & ".fldAdd") <> "") Then cmdInsert_varUsername =
Request(iLoop & ".fldUsername")
if(Request.Form(iLoop & ".fldAdd") <> "") Then cmdInsert_varDate =
Request(iLoop & ".fldDate")
if(Request.Form(iLoop & ".fldAdd") <> "") Then cmdInsert_varClassName =
Request(iLoop & ".fldClassName")


cmdInsert.CommandText = "INSERT INTO dbo.tblClasses (fldUserName, fldDate,
fldClassName) VALUES (('" + Replace(cmdInsert__varUsername, "'", "''") + "','"
+ Replace(cmdInsert__varDate, "'", "''") + "','" +
Replace(cmdInsert__varClassName, "'", "''") + "') WHERE '" +
Replace(cmdInsert__varAdd, "'", "''") + "' <> "") "
cmdInsert.CommandType = 1
cmdInsert.CommandTimeout = 0
cmdInsert.Prepared = true
cmdInsert.Execute()
End If
Next
set cmdInsert = Nothing
Response.Redirect("trainerchoose.asp")
End If
%>