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

Code,please go through

100+
P: 103
Expand|Select|Wrap|Line Numbers
  1. Private Sub ListView2_ItemClick(ByVal Item As MSComctlLib.ListItem)
  2. If ListView2.SelectedItem.Checked = True Then
  3.   rs.Open "select * from saldetail where date =  '" & ListView2.SelectedItem & "'", conn, adOpenStatic, adLockOptimistic
  4.   If Not rs.EOF Then
  5.     rs.MoveFirst
  6.     Do While Not rs.EOF
  7.       res1 = 0
  8.       If Trim(txttr.Text) = "" Then
  9.         Form3.txttamt.Text = ""
  10.         MsgBox "enter the tax rate", vbOKOnly, "ERROR"
  11.         cbostate.SetFocus
  12.       Else
  13.         res1 = txttr.Text / 100
  14.         ' rs.MoveNext
  15.       End If
  16.       txtoh.Text = Val(txthrs.Text - txthrs.Text)
  17.       txtotamt.Text = Val(txtoh.Text * txtotrt.Text)
  18.       res = Val(txthrs.Text * txtrate.Text)
  19.       Form3.txttamt.Text = Val(res * res1)
  20.       Form3.txtgros.Text = Val(txthrs.Text * txtrate.Text)
  21.       'str1 = txttr.Text
  22.       Form3.txtnsal.Text = Val(Form3.txtgros.Text - Form3.txttamt)
  23.       rs.Close
  24.       Set rs = Nothing
  25.  
If we click one record in the listview it should show the corresponding record from datbase.....

oneid--------------------several working days
so for each working day one record from the datbase..........
please go through....Thanks in advance
NICK
Jan 18 '08 #1
Share this Question
Share on Google+
5 Replies


debasisdas
Expert 5K+
P: 8,127
so, what is the problem ?
Jan 18 '08 #2

100+
P: 103
so, what is the problem ?
the control doesnot move out to each record in database,ie not displaying the record.
Jan 18 '08 #3

QVeen72
Expert 100+
P: 1,445
the control doesnot move out to each record in database,ie not displaying the record.
Your Do While does not have a "Loop"
I guess, your code does not even compile..
Properly Indent the Code, it will help you a lot to write Strurtured syntax..
Expand|Select|Wrap|Line Numbers
  1. Do While Not RS.EOF
  2.     'Your code to populate text box here
  3.     RS.MoveNext
  4. Loop
  5.  
Regards
Veena
Jan 18 '08 #4

debasisdas
Expert 5K+
P: 8,127
the control doesnot move out to each record in database,ie not displaying the record.
but,you are not retriving anything from recordset .
Jan 18 '08 #5

Expert 5K+
P: 8,434
Your Do While does not have a "Loop"
I guess, your code does not even compile..
Given that the code has obviously been compiled, it's evident that not all of it is posted here.

Perhaps it would help if the entire Sub were posted, at least.
Jan 21 '08 #6

Post your reply

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