[code=vb]
Private Sub ListView2_ItemC lick(ByVal Item As MSComctlLib.Lis tItem)
If ListView2.Selec tedItem.Checked = True Then
rs.Open "select * from saldetail where date = '" & ListView2.Selec tedItem & "'", conn, adOpenStatic, adLockOptimisti c
If Not rs.EOF Then
rs.MoveFirst
Do While Not rs.EOF
res1 = 0
If Trim(txttr.Text ) = "" Then
Form3.txttamt.T ext = ""
MsgBox "enter the tax rate", vbOKOnly, "ERROR"
cbostate.SetFoc us
Else
res1 = txttr.Text / 100
' rs.MoveNext
End If
txtoh.Text = Val(txthrs.Text - txthrs.Text)
txtotamt.Text = Val(txtoh.Text * txtotrt.Text)
res = Val(txthrs.Text * txtrate.Text)
Form3.txttamt.T ext = Val(res * res1)
Form3.txtgros.T ext = Val(txthrs.Text * txtrate.Text)
'str1 = txttr.Text
Form3.txtnsal.T ext = Val(Form3.txtgr os.Text - Form3.txttamt)
rs.Close
Set rs = Nothing
[/code]
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....Than ks in advance
NICK
Private Sub ListView2_ItemC lick(ByVal Item As MSComctlLib.Lis tItem)
If ListView2.Selec tedItem.Checked = True Then
rs.Open "select * from saldetail where date = '" & ListView2.Selec tedItem & "'", conn, adOpenStatic, adLockOptimisti c
If Not rs.EOF Then
rs.MoveFirst
Do While Not rs.EOF
res1 = 0
If Trim(txttr.Text ) = "" Then
Form3.txttamt.T ext = ""
MsgBox "enter the tax rate", vbOKOnly, "ERROR"
cbostate.SetFoc us
Else
res1 = txttr.Text / 100
' rs.MoveNext
End If
txtoh.Text = Val(txthrs.Text - txthrs.Text)
txtotamt.Text = Val(txtoh.Text * txtotrt.Text)
res = Val(txthrs.Text * txtrate.Text)
Form3.txttamt.T ext = Val(res * res1)
Form3.txtgros.T ext = Val(txthrs.Text * txtrate.Text)
'str1 = txttr.Text
Form3.txtnsal.T ext = Val(Form3.txtgr os.Text - Form3.txttamt)
rs.Close
Set rs = Nothing
[/code]
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....Than ks in advance
NICK
Comment