J
Jerrry D
Hi
When I select a category in the category combobox from the table named
categories I also want to select the corresponding cost and place the cost in
the cost textbox. It works fine to a point that only the first item in the
cost field is selected regardless of which item I select in the category
field. The event procedure in the combobox is
Private Sub CategoryName_AfterUpdate()
Dim strFilter As String
' Look up product's Cost and assign it to Cost control.
Me!Cost = DLookup("Cost", "Categories", strFilter)
Exit_CategoryName_AfterUpdate:
Exit Sub
End Sub
The row source in the combobox is SELECT Categories.CategoryName FROM
Categories;
How do I retrieve the cost for the categoryname that I select?
Thanks
When I select a category in the category combobox from the table named
categories I also want to select the corresponding cost and place the cost in
the cost textbox. It works fine to a point that only the first item in the
cost field is selected regardless of which item I select in the category
field. The event procedure in the combobox is
Private Sub CategoryName_AfterUpdate()
Dim strFilter As String
' Look up product's Cost and assign it to Cost control.
Me!Cost = DLookup("Cost", "Categories", strFilter)
Exit_CategoryName_AfterUpdate:
Exit Sub
End Sub
The row source in the combobox is SELECT Categories.CategoryName FROM
Categories;
How do I retrieve the cost for the categoryname that I select?
Thanks