ClaraBarton
Registered User.
- Local time
- Today, 07:51
- Joined
- Oct 14, 2019
- Messages
- 578
2 days I've stared at this:
Debug returns:
INSERT INTO tempGroceryList (PrefixII, Location, GroceryName) VALUES (F-1,Meat,hamburger)
The error is: too few parameters; expected 3
Or:
INSERT INTO tempGroceryList (PrefixII, Location, GroceryName) VALUES (F-1,Meat,flank steak)
syntax error. Missing operator in flank steak
Can you tell me what I'm missing?
Code:
Private Sub GroceryListTable()
Dim db As DAO.Database
Dim rst As Recordset
Dim frm As Form
Dim strSQL As String
Set db = CurrentDb
Set frm = Me!frmCalendarWeek.Form!fsubGrocery.Form
Set rst = frm.RecordsetClone
strSQL = "INSERT INTO tempGroceryList (PrefixII, Location, GroceryName) " & _
"VALUES (" & rst![PrefixII] & "," & rst![Location] & "," & rst![GroceryName] & ")"
CurrentDb.Execute "DELETE FROM tempGroceryList"
rst.MoveFirst
While Not rst.EOF
CurrentDb.Execute strSQL, dbFailOnError
rst.MoveNext
Wend
INSERT INTO tempGroceryList (PrefixII, Location, GroceryName) VALUES (F-1,Meat,hamburger)
The error is: too few parameters; expected 3
Or:
INSERT INTO tempGroceryList (PrefixII, Location, GroceryName) VALUES (F-1,Meat,flank steak)
syntax error. Missing operator in flank steak
Can you tell me what I'm missing?