By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,660 Members | 1,593 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,660 IT Pros & Developers. It's quick & easy.

problem in my Loop

syedshaffee
P: 91
hey people,

I have a problem in my loop it is not picking values from the last row please help

Expand|Select|Wrap|Line Numbers
  1. dim i
  2. dim checkboxValue
  3. dim TextBoxValue
  4.  
  5. dim Count
  6. dim Count1
  7. dim postion
  8. dim postion1
  9. position=0
  10. postion1=0
  11. i=0
  12. Checkbox1= Request.Form("same")
  13. Comments=Request.Form("Comments")
  14. strDate=Request.Form("Date")
  15. a=Split(Comments ,",")
  16. c=Split(strDate,",")
  17. b=Split(Checkbox1,",") 
  18.  
  19.  
  20. TextBoxValue=UBound(a)
  21. checkboxValue=UBound(b)
  22.  
  23. if TextBoxValue  > checkboxValue then
  24. for i=0 to  checkboxValue step 1
  25. objRIMSConn.Execute "Insert into Eot_returned (Contract_no,Asset_id,Date_to_be_excepted,Comments)values ('" + Session("Contract_no") + "'," + b(i) + ",'" + FormatDateTime(c(i),1)+ "','"+ a(i) +"');"
  26.  
  27. next
Example:
Expand|Select|Wrap|Line Numbers
  1. +-----+-------+-------+
  2. |     |       |       | < - 1st row
  3. +-----+-------+-------+
  4. |     |       |       | < - 2nd row 
  5. +-----+-------+-------+
  6. |     |       |       | < - 3rd row 
  7. +-----+-------+-------+
  8.  

the values are not been fetched from the last row
i think the problem is in the code
Expand|Select|Wrap|Line Numbers
  1. TextBoxValue=UBound(a)
  2. checkboxValue=UBound(b)
  3.  
how would i loop according to the values retrieved from the form
Feb 13 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.