UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Combo Box Rowsource Based On Selected Record In Continuous Form Or Datasheet, Access 2016    
 
   
MarkMeer
post Nov 22 2019, 03:06 PM
Post#1



Posts: 1
Joined: 20-November 19



SETUP:
Simple setup of 5 tables:

Entity Tables (self-explanatory):
- Chefs: ChefID (pk, autonumber), ChefName (ShortText)
- Foods: FoodID (pk, autonumber), FoodName (ShortText)
- Recipes: RecipeID (pk, autonumber), RecipeName (ShortText)

Junction Tables (for describing how much of each food each chef has, and how much of each food is required for each recipe)
- Chefs_Foods: fkChefID (number), fkFoodID (number), Stock (number)
- Foods_Recipes: fkFoodID (number), fkRecipeID (number), QtyRequired (number)

GOAL:
I'd like to create a form for chefs that list all their foods in stock (a continuous form or datasheet), and have a combo box next to each where they can select a recipe appropriate to the food, and the amount they have in stock. They can then print a "CookingPlan" report summarizing the recipes they've chosen to make with each food.

PLAN:
Given a food (FoodID) and a number (Stock), I created a query ("Recipes_for_Chef_Foods") that gives RecipeID's of all recipes that can be used. My plan was to have this as the RowSource in the Datasheet/Continuous Form combo box.

DIFFICULTIES:
I'm having the following difficulties:
  1. What are the properties of the recipe-selection combo box? If it's unbound, then it doesn't appear to work with the continuous form/datasheet. If bound, I'm not sure what it should be bound to, or what would be the appropriate relationships.
  2. How to update the RowSource when the user selects a new record in the ContinuousForm/Datasheet? I've tried the "After Update" and "On Current" events to execute a requery, but this appears to affect all the other rows.


Anyway, sufficed to say that I cannot get this (seemingly simple) setup to work.
Any help / advice / links to help out this relative newbie to Access/Databases achieve the stated goal would be much appreciated! wink.gif

Thanks in advance!
MM.
Go to the top of the page
 
theDBguy
post Nov 22 2019, 03:36 PM
Post#2


UA Moderator
Posts: 76,801
Joined: 19-June 07
From: SunnySandyEggo


Hi Mark. Welcome to UtterAccess! welcome2UA.gif

Are you able to post a sample copy of your db with test data? It might be easier to offer suggestions if we can see what you got so far.

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    6th December 2019 - 07:50 AM