Question : Problem with insert into query..

Hello, this inset into query is gving me a 3127 error:

The INSERT INTO statement contains the following unknown field name: ‘TblMulti-Assign.TaskID’. Make sure you have typed the name correctly, and try the operation again. Error 3127

 However I have checked and double checked the field names. I am certain they are all spelled correctly.

Here are the fields in the table “TblMulti-Assign”
TaskID = Long
TypeID = Long
TypeName = Text
ChildID = Long
ChildName = Text

I also was able to manually add a record to the table so I know it’s not a data problem.

Here's the query:
strSQL = "INSERT INTO [TblMulti-Assign] ([TblMulti-Assign].[TaskID], [TblMulti-Assign].[TypeID], [TblMulti-Assign].[TypeName], [TblMulti-Assign].[ChildID], [TblMulti-Assign].[ChildName])" & _
" VALUES (" & pub2TaskID & ", " & "1 , " & "'" & "Issue" & "'" & " ," & Me.SubFrmNewTaskIssue.Form!IssueID.Value & ", " & "'" & Me.SubFrmNewTaskIssue.Form!IssueName.Value & "'" & ");"

The query trransalate out to:
"INSERT INTO [TblMulti-Assign] ([TblMulti-Assign].[TaskID], [TblMulti-Assign].[TypeID], [TblMulti-Assign].[TypeName], [TblMulti-Assign].[ChildID], [TblMulti-Assign].[ChildName]) VALUES (274, 1, 'Issue', 1, 'Social Services');"

Does any one see what is wrong here?  Thanks, Jake

Answer : Problem with insert into query..

It looks OK...

You could try the simplified...

strSQL = "INSERT INTO [TblMulti-Assign] (TaskID, TypeID, TypeName, ChildID, ChildName)" & _
" VALUES (" & pub2TaskID & ", 1 , 'Issue' , " & Me.SubFrmNewTaskIssue.Form!IssueID.Value & ", '" & Me.SubFrmNewTaskIssue.Form!IssueName.Value & "');"

Random Solutions  
 
programming4us programming4us