I have added another column header to my listview 'VAT' that loads from another table and populates to the listview. so far that is working fine now am trying to save the information on the listview to another table which is proving to be difficult.
Ive been searching on the web for a week now but in vain here is my code on loading to listview
Public Sub cmdLookup_Click()
On Error GoTo SearchError
With Connect.rsitem
.Filter = "Itemno = '" & txtSearch.Text & "' or desc1 like '" & txtSearch.Text & _
"*' or desc2 like '" & txtSearch.Text & "*' or upc = '" & txtSearch.Text & "'"
.Open
If .RecordCount > 1 Then
FrmSearch.Show vbModal
End If
If .RecordCount > 0 Then
QtyRemain = !onhandqty
If QtyRemain > 0 Then
Set x = ListView.ListItems.Add(, , !itemno)
x.SubItems(1) = !desc1
x.SubItems(2) = !desc2
x.SubItems(3) = !Size
x.SubItems(4) = 1
x.SubItems(5) = FormatNumber(!unitprice)
x.SubItems(6) = FormatNumber(!unitprice)
x.SubItems(7) = !upc
x.SubItems(8) = !Vat
x.EnsureVisible
x.Selected = True
'Saving part
Public Sub SaveSales()
Dim i As Integer
i = 1
Do Until i = (ListView.ListItems.Count + 1)
With ListView.ListItems(i)
Connect.AddSales txtinvoice.Text, .Text, .SubItems(4), .SubItems(6), txtdate.Text, txtSubTotal.Text, _
txtDiscount.Text, txtTotal.Text, frmPayment.txtCash.Text, _
CDbl(frmPayment.txtCash.Text) - CDbl(txtTotal.Text), "Open", frmLogin.Cashier
End With
i = i + 1
Loop
End Sub
am trying to include the VAT that i have added on the listview to save on the table. i dont know how to go about it am new to vb... thanks
Ive been searching on the web for a week now but in vain here is my code on loading to listview
Public Sub cmdLookup_Click()
On Error GoTo SearchError
With Connect.rsitem
.Filter = "Itemno = '" & txtSearch.Text & "' or desc1 like '" & txtSearch.Text & _
"*' or desc2 like '" & txtSearch.Text & "*' or upc = '" & txtSearch.Text & "'"
.Open
If .RecordCount > 1 Then
FrmSearch.Show vbModal
End If
If .RecordCount > 0 Then
QtyRemain = !onhandqty
If QtyRemain > 0 Then
Set x = ListView.ListItems.Add(, , !itemno)
x.SubItems(1) = !desc1
x.SubItems(2) = !desc2
x.SubItems(3) = !Size
x.SubItems(4) = 1
x.SubItems(5) = FormatNumber(!unitprice)
x.SubItems(6) = FormatNumber(!unitprice)
x.SubItems(7) = !upc
x.SubItems(8) = !Vat
x.EnsureVisible
x.Selected = True
'Saving part
Public Sub SaveSales()
Dim i As Integer
i = 1
Do Until i = (ListView.ListItems.Count + 1)
With ListView.ListItems(i)
Connect.AddSales txtinvoice.Text, .Text, .SubItems(4), .SubItems(6), txtdate.Text, txtSubTotal.Text, _
txtDiscount.Text, txtTotal.Text, frmPayment.txtCash.Text, _
CDbl(frmPayment.txtCash.Text) - CDbl(txtTotal.Text), "Open", frmLogin.Cashier
End With
i = i + 1
Loop
End Sub
am trying to include the VAT that i have added on the listview to save on the table. i dont know how to go about it am new to vb... thanks