I created an Access 2007 form that displays, for example, "Products from the product table." One of the fields in the Product table is the CategoryID corresponding to this parent product category.
In the form, the category identifier should be presented as a combo box associated with the Category table. The idea here is quite simple: when choosing a new category, you must update the CategoryID in the Product table.
The problem I ran into is that when choosing a new category, updating the CategoryName category of the Category table instead of updating the CategoryID in the Product table. The reason for this is that it seems that the combo box should only be bound to the CategoryName of the Category table.
What happens if the current product has CategoryID 12, which is the CategoryName "Chairs" in the Category table, and then selects a new value, say "Tables" (CategoryID 13) in the combo box, updates CategoryID 12 with a new "Tables" category table instead Updates the Product CategoryID table to 13.
How to bind the Category table to a combox block, so that the datatext field (which I want to exist in Access) is CategoryName, and the datavalue field is CategoryID, and only the CategoryID field of the product will be updated when the selected combo box item is changed?
Edit: See accepted answer below. I also needed to change the number of columns by 2, and everything began to work perfectly.
data-binding ms-access forms combobox
Jordan arron
source share