If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
RunTime Error 3134
What are the fields in your tblMovement table?
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "ajhome" wrote in message ... I tried, and it still didn't work. I have also changed that field name to logon. "Douglas J. Steele" wrote: One possibility is your field CurrentUser: that's a reserved word, and so can lead to problems. (For a great discussion on what names to avoid in Access, see what Allen Browne has at http://www.allenbrowne.com/Ap****ueBadWord.html) For now, try enclosing it in square brackets strSQL = "INSERT INTO tblMovement " & _ "(EmpID, InsertDate, EffectiveDate, [CurrentUser], " & _ "NewSupervisor, NewTitle, NewCenter) " & _ etc If that solves the issue, consider renaming the field (even though that's a lot of work...) -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "ajhome" wrote in message ... Good Morning, It tells me the following message: "The INSERT INTO statement contains the following unknown field name: 'NewSupervisor'. When I take that field out, I get the same error message for the other fields as well. I have doubled checked my form and table to make sure that I have spelled everything correctly and the same, and I have. What else could be causing that error? "Douglas J. Steele" wrote: Try changing to: Dim strSQL As String strSQL = "INSERT INTO tblMovement " & _ "(EmpID, InsertDate, EffectiveDate, CurrentUser, " & _ "NewSupervisor, NewTitle, NewCenter) " & _ "VALUES (" & lstSelectEmp.Column(0) & ", " & _ Format(txtInsertDate, "\#yyyy\-mm\-dd\#") & _ "," & Format(txtEffectiveDate, "\#yyyy\-mm\-dd\#") & ", " & _ Chr$(34) & txtCurrent & Chr$(34) & ", " & _ Chr$(34) & cboNewSupervisor & Chr$(34) & ", " & _ Chr$(34) & cboNewTitle & Chr$(34) & ", " & _ Chr$(34) & cboNewCenter & Chr$(34) & ")" Debug.Print strSQL CurrentDb.Execute strSQL, dbFailOnError When the code runs, go to the Immediate Window (Ctrl-G) and look at the SQL string that was written there. Does it look correct? What happens if you create a query, paste that same SQL into it and run it? Does adding the dbFailOnError parameter cause any meaning error to be raised? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) |
Thread Tools | |
Display Modes | |
|
|