==================================编辑========= =========================
我遇到了一些错误,所以我通过执行以下操作来解决问题:
Me.ADComponentNumber.RowSource = "SELECT [Components].[ID], [Components].[ComponentNumber] FROM Components WHERE [Components].[Items_Id] = " + Me.ADItemNumber.Column(0) + " ORDER BY [Components].[ComponentNumber]"
============================================ =============================
我想从Db表中以编程方式填充组合列表。我尝试了一些像设置RowSource的东西,但它没有用。请参阅下面的代码:
// Basically when a user selects an item form `Item Number` combo list
// The `ADItemNumber_Change()` function is supposed to get the `Item.ID` (Column(0)) number
// and feed it to the `ADComponentNumber.RowSource`, which is then supposed to
// fill the list with Components whose `Components.Item_ID` fields matches `Item.ID` number.
// NOTHING IS GETTING FILLED OUT IN THE LIST...
Private Sub ADItemNumber_Change()
Me.ADComponentNumber.RowSource = vbNullString
Me.ADComponentNumber.RowSourceType = "Table/Query"
Me.ADComponentNumber.RowSource = "SELECT [Components].[ID], [Components].[ComponentsNumber] FROM Components WHERE [Components].[Items_Id] = Me.ADItemNumber.Column(0) ORDER BY [Components].[ComponentNumber]"
Me.Refresh
End Sub
我确信我错过了让它发挥作用的东西。
谢谢,
答案 0 :(得分:0)
我能解决自己的问题。请参阅我的问题中的编辑部分