|
各位高手,请出手相助一下,这个窗口内的项目怎么不显示,而且取的值也不对?
烦请帮忙修改一下,谢谢啦!
Private Sub UserForm_Initialize() '作用:初始化listview1控件
With ListView1
.ColumnHeaders.Add , , "ID"
.ColumnHeaders.Add , , "供应商代码"
.ColumnHeaders.Add , , "供应商简称"
.ColumnHeaders.Add , , "供应商名称"
.View = lvwReport
.Gridlines = True
End With
Exit Sub
End Sub
Private Sub CommandButton1_Click() On Error Resume Next
Call Open_database
SQL = "select * from 供应商 "
RST.Open SQL, CNN, adOpenKeyset, adLockReadOnly
With ListView1
RST.MoveFirst
Set ITM = .ListItems.Add()
ITM.Text = RST.Fields("ID")
ITM.SubItems(1) = RST.Fields("供应商代码")
ITM.SubItems(2) = RST.Fields("供应商简称")
ITM.SubItems(3) = RST.Fields("供应商名称")
RST.MoveNext
End With
Exit Sub
Close_database
End Sub |
|