Hello friends!
John Viescas, nice to see you posting. Hope you had a good time doing whatever you were off doing.
I'm trying to capture a value from a form and a calculated value and save them into a table using Insert Into but can't seem to get the syntax correct. I've verified both values as working correctly through the immediate window, however I can't seem to save them in a table. The table has only 2 fields, ID and Contestant. I'm using the following code:
'Save word to WordsDrawn Table
Dim intWDID As Integer
Dim strWord As String
Dim strSQL As String
intWDID = Nz(DMax("ID", "WordsDrawn") + 1, 1)
Debug.Print intWDID
strWord = Me.txtName
Debug.Print strWord
strSQL = "Insert INTO [WordsDrawn](ID, Contestants) Values (intWDID, strWord)"
Debug.Print strSQL
Dim db As DAO.Database
'Point to this database
Set db = CurrentDb
CurrentDb.Execute strSQL, dbFailOnError
When I execute this code I get a runtime error 3601: Too few parameters. Expected 2.
I appreciate any help.
Doyce
Senin, 26 September 2011
[MS_AccessPros] Insert Into Syntax help
__._,_.___
MARKETPLACE
.
__,_._,___
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar