A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

RunTime Error 3134



 
 
Thread Tools Display Modes
  #1  
Old May 30th, 2007, 05:08 PM posted to microsoft.public.access.forms
Douglas J. Steele
external usenet poster
 
Posts: 9,313
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:52 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.