I have a table called tblFoodOrder which has 2 fields, FoodName and Number, so Eggs, 23; Bacon 47 and so on. Using the form frmFoodOrder I want the user to be able to enter a number in the uncontrolled text box called Normal, that will update the Number field, dependant on the FoodName. The code I have so far is..
Private Sub Command18_Click()
Dim dbs As Database
Set dbs = OpenDatabase("C:\Users\Mum\Documents\dbTestMenu.ac cdb")
dbs.Execute " UPDATE tblFoodOrder " _
& " Set FoodAmount = 36 " _
& " WHERE FoodName = 'Eggs'; "
dbs.Execute " UPDATE tblFoodOrder " _
& " Set FoodAmount = Forms![frmFoodOrder]![Normal] " _
& " WHERE FoodName = 'Bacon';"
dbs.Close
End Sub
This works updating the number of Eggs to 36 ,in the table tblFoodOrder, but wont work using a number entered in an uncontrolled text box named Normal on the form frmFoodOrder
to update the number of bacon rashers.
Any help greatly appreciated
Muz