For start, you have to create tables where you register various info handled in your DB. Related to your post #1, you need tables like:
tblFoodCategories: FoodCategotyID, FoodCategory (my advice is, FoodCategoryID will be autonumeric, and FoodCategory text);
tblFoods: FoodID, FoodName, FoodCategoryID (FoodID will be Autonumeric, FoodName will be text, and FoodCategoryID will be long integer and is a foreign key linking food category with food. I'd prefer using long integer FK linking to autonumeric PK in source table, as this way you can at any time edit food categories texts when there is a need for it.).
Then you have a table, where you added a row, and need to insert a food info into this row. I.e. this row has the field like FoodID (a long integer FK, which links some food from tblFoods with the row you are editing in your work table. In your form, to select this food you use a combo box which is linked to FoodID FK. To select the food of specific category, you either:
Have a unbound combo box in your form, where you can select a category, and whenever you change the category, the RowSource property for combo box to select food item is updated, so the query there is filtered by setting WHERE clause to FoodCategoryID selected in 1st combo (a solution posted by Welshgasman);
Have the RowSource of the combo for food item selection in your form like:
Code:
SELECT f.FoodID, fc.FoodCategory & ": " & f.FoodName As Food FROM tblFoods f INNER JOIN tblFoodCategories fc ON fc. FoodCategoryID = f.FoodCategoryID ORDER BY 2 Asc
With 2nd solution, the combo displays and selects foods like "dairy: milk". When you activate the combo, and start typing with 'd' then combo starts suggest foods, which belong to categories starting with 'd' and alphabetically down from there. You continue typing until food items starting with "dairy" are displayed, and select the product you want from those.