Forum Moderators: open
I have an access database with 3 tables: "People", "Services" and "Offered" which is related to both.
Offered is used to record who offers which services.
I need to build an insert record form that lists all the services (a repeat region built from the services table) as check boxes. This will need to insert multiple records on submit so each service ID is record against the persons id already establish as a passed variable in a query string.
I understand I need some sort of looping statement that handles the inserts but, my meagre coding skills (note. I use Dreamweaver!) can't handle this. I cannot seem to find any tips via Google either.
Any help would be appreciated.
if (String(Request("upd"))!= "undefined") {
var Cmd = Server.CreateObject('ADODB.Command');
Cmd.ActiveConnection = connForms;
for ( j = 1; j <= frmcnt; j++ ) {
var joe = (Request("seq"+j) == "")?0:Request("seq"+j);
var sql = "update form4list set seq=" + joe + " where rrn=" + Request("rn" + j);
Cmd.CommandText = sql;
Cmd.Execute();
} // for loop
Cmd.ActiveConnection.Close();
Cmd = null;
Response.Redirect("schedule.asp");
}
You need to now how many loops to make, I set some variables to accept the Request values, and make the SQL dynamic.