Looping logic error

I have to asp pages each containing a form . First is a pre-registration form which would input the leader or the main person contact person , and second a registration form which would input the information such as name adresss and so forth of the rest of the team members. The code works 90 % ok, but i am having troubles with the following.

Email is not sent to no one .
TIID which is the column that holds the team id is incremented one more time of what is supposed to..\ ( I am getting Team Id  one ok second ok, ... and a extra column with blank values other than regdate , regtime which i get from function no input.

I suspect this has to do with my counter and the loop i Have , it use to work fine with a single page registration but now is having bugs,, if anyone can notice whats my error on the logic on this implemenation and how can i fix it, I apreciate.
If (Request.Form("Submit")<>"") Then
		session("r_mcount") = Request.Form("memcounter")
		session("r_tourname") = Request.Form("tourname")
		session("r_teamname") = Request.Form("txtteamname")
		session("r_txtcourseid") = Request.Form("txtcourseid")
		'session("r_txttourid")= TID
		'do we need an user name also here ?
		mcount2 = session("s_memcounter")
		For p=1 to mcount2 
					session("r_txtfname"&p) = Request.Form("txtfname"&p)
					session("r_txtlname"&p) = Request.Form("txtlname"&p)
					session("r_txtemailid"&p) = Request.Form("txtemailid"&p)
					response.write "tname :" & session("r_txtfname"&p)
					' Retrieve from session variable ???
					TID= session("s_TID")
					' Retrieve local vars 
conSQL.execute("Insert into Players(teamname,firstname,lastname,addy1,addy2,city,state,Zip,phone,email,regdate,regtime,TourID,Shirtsize,Handicap,courseID,TIID,golfball,golfclub) values('"&teamname&"','"&txtfname&"','"&txtlname&"','"&txtaddr1&"','"&txtaddr2&"','"&txtcity&"','"&txtstate&"','"&txtpcode&"','"&txtcontactno&"','"&txtemailid&"','"&regdate&"','"&regtime&"','"&TID&"','"&txtshirtsize&"','"&txthandicap&"','"&txthomecourse&"','"&TIID&"','"&txtball&"','"&txtclub&"')")
					If Err.Number <> 0 Then
		Response.Write "Error: " & Err.Description
			Response.Write "Unable to Store your Information "
		end if
					Set rsNewListMember=Server.CreateObject("ADODB.Recordset")
					strSQL = "SELECT tblMailingList.* FROM tblMailingList;"
					rsNewListMember.Open strSQL, con3SQL
					Randomize Timer
						dim strEmailAdress
			        strUserCode = Left(strEmailAddress,2) & (9876989856 * CInt((RND * 32000) + 100))
					Do While NOT rsNewListMember.EOF
				        If strUserCode = rsNewListMember("ID_Code") Then
					        Randomize Timer
					        strUserCode = Left(strEmailAddress,2) & (9876989856 * CInt((RND * 32000) + 100))
				        End If
                        If strEmailAddress = txtemailid Then
                              blnError = True
                              Exit Do
                        End If
			        If strEmailAddress = txtemailid Then
				        blnError = True
				        'Exit Do
			        End If
set rsTournamentinf = Server.CreateObject("ADODB.Recordset")
sql = "Select * From tblTournament WHERE TourID  = '" & session("s_TID") & "'" 
rsTournamentinf.Open sql,conSQL    
          ' variable used for the email    
location = rsTournamentinf("TourLocation")
dayoftour =  rsTournamentinf("TourStartDate")
contactp = 	rsTournamentinf("ContactPersonName")	
contactphone = rsTournamentinf("ContactPersonPhone")	
contactpemail = rsTournamentinf("ContactPersonEmail")
                '    Set MyCDO1 =CreateObject("CDO.Message")
				'	MyCDO1.To = txtemailid
	             '   MyCDO1.From = "info@playerscores.com"
	              '  MyCDO1.Subject = "Tournament signup confirmation from playerscores.com "
'MyCDO1.HTMLBody = " <br><br>Thanks for registering your team<b> "& session("s_teamname")&"</b> online with 	the <b>"& session("s_tourname") &"</b><br> If you have any questions please do not hesitate to email us at info@playerscores.com  <br><br><br> <b>Tournament Information</b> :<br><br> Tournament Name :"& session("s_tourname") &" <br> Golf Course <br>  Location : "&location&" <br> Date:"&dayoftour&"<br><br> For more information you can contact : "&contactp&" at  "&contactphone&"<br> "&contactpemail&"<br>  <br> 	<br>Thanks<br>PlayerScores.com Staff"
 '                   MyCDO1.Configuration.Fields.Item _
   '                 ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
  '                  'Name or IP of remote SMTP server
     '               MyCDO1.Configuration.Fields.Item _
    '                ("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
      '              =""
                    'Server port
         '           MyCDO1.Configuration.Fields.Item _
       ''             ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
           '         =25
          '          MyCDO1.Configuration.Fields.Update
 '                   MyCDO1.Send
'on error resume next 	         
		            If blnError = False Then
		                Set rsNewListMemberc = Server.CreateObject("ADODB.Recordset")
		                strSQLC = "SELECT * FROM tblMailingList where Email='"&txtemailid&"'"
		                rsNewListMemberC.Open strSQLC, con3SQL
	                    If rsNewListMemberC.EOF Then
                            con3SQL.execute("Insert into tblMailingList(Email,ID_Code) values('"&txtemailid&"','"&strUserCode&"')")
					    End If
				    End If
				    Set rsNewListMember = Nothing
		dim cmd
set cmd = Server.CreateObject("AdoDB.Command")
'dim cn
'set cn = Server.CreateObject("AdoDb.Connection")
'cn.connectionString = MyconnectionString
set cmd.ActiveConnection = ConSQL
cmd.CommandText = "Select AvailableSpots From tblTournament WHERE TourID = "&TID&"  "
 if cmd.Execute().fields(0).Value > 0 then
 'There's an available spot ... claim it
 'cmd.CommandText = "Update tblTournament set MaxTeams = MaxTeams-1"
  cmd.CommandText = "Update tblTournament set AvailableSpots = AvailableSpots-1 WHERE TourID = "&TID&"  "
  end if
		' clean up
		set MyCDO=nothing
	end if

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

can you try changing this

For p=1 to mcount2


For p=1 to mcount2 - 1
RickyGtzAuthor Commented:
is almost working , but now i have to fix the index variable  ' i '  so the player number is displayed correctly, meabe a do while,  or a for within a for loop

this would start on player 1
				if nct="" then
				nct= 1
				End if
				For i=1 to nct
				<table width="100%" height="100%" align="center" cellpadding="5" cellspacing="0" class="bodytxt1" >
                      <tr align="left">
                        <td colspan="2" class="tableheader" >Player<%=i%> Personal Information                        </td>

Open in new window

can you tell me more, with sample what it has to show and what it is showing now

C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

RickyGtzAuthor Commented:

sure it shows on the form tabel tab the number of the player this is, since the first member regustered on pre form , i want this to start on player <2>
Now the logic is i use a counter to the whole loop as you can see on the code above with
For i=1 to nct
so , the one thing i wantis  to use  say variable k =2  on
<td colspan="2" class="tableheader" >Player<%=k%> Personal Information                        </td>
and make this also increments on each iteration,

similar on this live view,,

Open in new window

cant you do like this

Player<%=i + 1%>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RickyGtzAuthor Commented:
I am so dumb, lol, yes that works, i need to get some sleep now...  thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.