【发布时间】:2017-11-27 19:57:08
【问题描述】:
我有一个用户表单,他们应该从工作表中的表格中选择供应商,当他们按下“ShowProducts”命令时,表单应该在下面的文本框中显示该供应商的所有文章。
我编写了以下代码,但它在If Suppl.Value = Me.LstB_Supplier.Value Then 行上一直给我一个错误。
我已经搜索并尝试了我在此网站和其他网站上找到的不同选项,但我似乎无法找到问题所在。
谁能帮帮我?谢谢!
Private Sub Cmd_ShowProducts_Click()
Dim Suppl As Range
Dim i As Integer
For Each Suppl In Range("T_Prod_Fix[Supplier Name]")
If Suppl.Value = Me.LstB_Supplier.Value Then
With Me.LstB_Products
.AddItem
.List(i, 0) = Suppl.Offset(0, 1).Value 'article nbr
.List(i, 1) = Suppl.Offset(0, -1).Value 'article name
i = i + 1
End With
End If
Next Suppl
End Sub
【问题讨论】:
-
id
LstB_SupplierTextBox或ListBox?