A
Aries via AccessMonster.com
Help in cascading combo box coding. I have this code but when I click
"cboProduct" it asks me for parameter value. what could be wrong with this?
cboManufacturer and cboCategory are unbound and cboProduct is bound. the form
is bound to tblStockInventory for inventrory transaction entries.
Private Sub cboCategory_AfterUpdate()
With Me![cboProduct]
If IsNull(Me!cboCategory) Then
.RowSource = ""
Else
.RowSource = "SELECT [ProductName] " & _
"FROM Products " & _
"WHERE [CategoryID]=" & Me!cboCategory
End If
Call .Requery
End With
End Sub
Private Sub cboManufacturer_AfterUpdate()
With Me![cboCategory]
If IsNull(Me!cboManufacturer) Then
.RowSource = ""
Else
.RowSource = "SELECT [CategoryName] " & _
"FROM Manufacturer_Category INNER JOIN ProductCategory ON
Manufacturer_Category.CategoryID = ProductCategory.CategoryID " & _
"WHERE [ManufacturerID]=" & Me!cboManufacturer
End If
Call .Requery
End With
End Sub
I currently have these tables
Manufacturer
ManufacturerID - Pk
ManufacturerName
Category
CategoryID - Pk
CategoryName
Products
ProductID - Pk
ProductName
CategoryID
ManufacturerID
StockInventory
InventoryID - Pk
ProductID
CategoryID
TransactionDate
Qty
Amount
Manufacturer_Category
ID -Pk
ManufacturerID
CategoryID
Hope you can help me. Thanks!
"cboProduct" it asks me for parameter value. what could be wrong with this?
cboManufacturer and cboCategory are unbound and cboProduct is bound. the form
is bound to tblStockInventory for inventrory transaction entries.
Private Sub cboCategory_AfterUpdate()
With Me![cboProduct]
If IsNull(Me!cboCategory) Then
.RowSource = ""
Else
.RowSource = "SELECT [ProductName] " & _
"FROM Products " & _
"WHERE [CategoryID]=" & Me!cboCategory
End If
Call .Requery
End With
End Sub
Private Sub cboManufacturer_AfterUpdate()
With Me![cboCategory]
If IsNull(Me!cboManufacturer) Then
.RowSource = ""
Else
.RowSource = "SELECT [CategoryName] " & _
"FROM Manufacturer_Category INNER JOIN ProductCategory ON
Manufacturer_Category.CategoryID = ProductCategory.CategoryID " & _
"WHERE [ManufacturerID]=" & Me!cboManufacturer
End If
Call .Requery
End With
End Sub
I currently have these tables
Manufacturer
ManufacturerID - Pk
ManufacturerName
Category
CategoryID - Pk
CategoryName
Products
ProductID - Pk
ProductName
CategoryID
ManufacturerID
StockInventory
InventoryID - Pk
ProductID
CategoryID
TransactionDate
Qty
Amount
Manufacturer_Category
ID -Pk
ManufacturerID
CategoryID
Hope you can help me. Thanks!