C
cbrennan
Hello, I am writing a recipe management application in Access and could
use some help figuring out how to create a form to display any given
recipe.
I have defined the database such that one recipe can include another,
for example:
recipe A: "pizza crust"
ingredient 1
ingredient 2
....
recipe B: "pizza"
ingredient 1 = "pizza crust" = recipe A
ingredient 2
ingredient 3
.....
I don't understand how to output the expanded recipe B to include all
the ingredients from recipe A.
My first thought was to do a query on recipe A in VB, then iterate
through the recordset and do more queries whenever I ran into an
ingredient that is another recipe. For every ingredient that isn't a
recipe, I would add a text label control with the ingredient details to
the form, and when complete, the user would see all the ingredients on
the form. Coming from a web design background, this seemed like the way
to go, but in Access it seems really hard to do dynamic form creation.
I understand that I would have to put the form into creation mode, add
the controls, save the form, then redisplay.
I've been researching for a better way, so now it seems like the thing
to do is create a temporary table and feed the results of the queries
into it, then when all the data is ready, set this table as the source
for a form, and display that.
I already have a form made for selecting the recipe to display, and a
button to initiate the code to display the expanded recipe. If I can
write the code to output the expanded recipe to a temp table and create
a form from this table, can I then show this new form in a subform
object embedded in my selector form?
Can someone tell me if this approach makes sense? To all you Access
experts out there, what seems like the "right way" to go about doing
what I am trying to do in this case?
Thanks in advance for any help!
-An Access newbie
use some help figuring out how to create a form to display any given
recipe.
I have defined the database such that one recipe can include another,
for example:
recipe A: "pizza crust"
ingredient 1
ingredient 2
....
recipe B: "pizza"
ingredient 1 = "pizza crust" = recipe A
ingredient 2
ingredient 3
.....
I don't understand how to output the expanded recipe B to include all
the ingredients from recipe A.
My first thought was to do a query on recipe A in VB, then iterate
through the recordset and do more queries whenever I ran into an
ingredient that is another recipe. For every ingredient that isn't a
recipe, I would add a text label control with the ingredient details to
the form, and when complete, the user would see all the ingredients on
the form. Coming from a web design background, this seemed like the way
to go, but in Access it seems really hard to do dynamic form creation.
I understand that I would have to put the form into creation mode, add
the controls, save the form, then redisplay.
I've been researching for a better way, so now it seems like the thing
to do is create a temporary table and feed the results of the queries
into it, then when all the data is ready, set this table as the source
for a form, and display that.
I already have a form made for selecting the recipe to display, and a
button to initiate the code to display the expanded recipe. If I can
write the code to output the expanded recipe to a temp table and create
a form from this table, can I then show this new form in a subform
object embedded in my selector form?
Can someone tell me if this approach makes sense? To all you Access
experts out there, what seems like the "right way" to go about doing
what I am trying to do in this case?
Thanks in advance for any help!
-An Access newbie