B
brianv
i am having trouble insert a rcd into a tbl using an expression on dbl click
Tbl: Ingredients
IngredientId autoNumber Primary Key
Ingredient text
These is the starting data in the tbl:
IngredientId Ingredient
10 salt
14 butter
15 milk
on a form i have a Text Box Named IngredientTB
i type data into the text box, onion, and then dbl click it.
event dbl click starts an express which looks like this:
Private Sub IngredientTB_DblClick(Cancel As Integer)
DoCmd.RunSQL "Insert INTO Ingredients(Ingredient) Values ('" &
Me.IngredientTB & "')"
Rem Refreshes form data
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
End Sub
when i do this a rcd gets added but the Ingredient value is blank.
here is the data now:
IngredientId Ingredient
10 salt
14 butter
15 milk
24
then i add another Ingredient like flour. after dbl clicking the row gets
added. now if i look at the tbl i still have the blank Ingredient and now i
have onion also.
here is the data now:
IngredientId Ingredient
10 salt
14 butter
15 milk
24
25 onion
it is like 1 value behind. i have no idea what could be going on.
Tbl: Ingredients
IngredientId autoNumber Primary Key
Ingredient text
These is the starting data in the tbl:
IngredientId Ingredient
10 salt
14 butter
15 milk
on a form i have a Text Box Named IngredientTB
i type data into the text box, onion, and then dbl click it.
event dbl click starts an express which looks like this:
Private Sub IngredientTB_DblClick(Cancel As Integer)
DoCmd.RunSQL "Insert INTO Ingredients(Ingredient) Values ('" &
Me.IngredientTB & "')"
Rem Refreshes form data
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
End Sub
when i do this a rcd gets added but the Ingredient value is blank.
here is the data now:
IngredientId Ingredient
10 salt
14 butter
15 milk
24
then i add another Ingredient like flour. after dbl clicking the row gets
added. now if i look at the tbl i still have the blank Ingredient and now i
have onion also.
here is the data now:
IngredientId Ingredient
10 salt
14 butter
15 milk
24
25 onion
it is like 1 value behind. i have no idea what could be going on.