B
brianv
i have a form [Add an Ingredient] which has a List box [ListIngredient].
ListIngredient has 3 fields, IngredientId, Ingredient and Note. these are
the fields in tbl Ingredients.
Ingredients:
IngredientId autoNumber Primary Key
Ingredient text
Note text
what i am trying to do is update the data for a selected rcd. so i click a
rcd in the List box to select it. i then click a button which will execute
an event procedure. the procedure needs to open a form [Change Ingredient]
and pass the 3 values into it. i started off by just trying to pass 1 value.
this is what i have
stDocName = "Change Ingredient"
DoCmd.OpenForm stDocName, , , "[ChgIngredient]='" & [Forms]![Add an
Ingredient]!ListIngredient.Column(1) & "'"
this is in the code for the button on the first form. can you tell me what i
am doing wrong and what the syntax looks like to pass all 3 values. i plan
on hidding the IngredientId on the second form. allow the user to change the
values in the other fields and then push a button which will do the update.
i have never used Visual Basic or access before. if there is a better way, i
am all ears.
thanks
brian
ListIngredient has 3 fields, IngredientId, Ingredient and Note. these are
the fields in tbl Ingredients.
Ingredients:
IngredientId autoNumber Primary Key
Ingredient text
Note text
what i am trying to do is update the data for a selected rcd. so i click a
rcd in the List box to select it. i then click a button which will execute
an event procedure. the procedure needs to open a form [Change Ingredient]
and pass the 3 values into it. i started off by just trying to pass 1 value.
this is what i have
stDocName = "Change Ingredient"
DoCmd.OpenForm stDocName, , , "[ChgIngredient]='" & [Forms]![Add an
Ingredient]!ListIngredient.Column(1) & "'"
this is in the code for the button on the first form. can you tell me what i
am doing wrong and what the syntax looks like to pass all 3 values. i plan
on hidding the IngredientId on the second form. allow the user to change the
values in the other fields and then push a button which will do the update.
i have never used Visual Basic or access before. if there is a better way, i
am all ears.
thanks
brian