0
我已將另一個列標題添加到我的列表視圖'VAT'中,該列表從另一個表中加載並填充到列表視圖。到目前爲止工作正常,現在我試圖將列表視圖中的信息保存到另一個表格中,這被證明是困難的。將列表視圖內容保存到ms訪問db
香港專業教育學院現在已經在網上搜索了一個星期,卻徒勞無功這裏是我的代碼在加載到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
保存部分
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
什麼/錯誤在哪裏? – George
沒有錯誤,我試圖包括增值稅,我已經添加到列表視圖保存在表上。我不知道如何去它是新的vb ...謝謝 – user2424647
當我嘗試添加.SubItems(8)我得到錯誤沒有datamember。有人請幫忙 – user2424647