UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Getting Run-time Error 3061, Access 2016    
 
   
SheriDi
post Jan 1 2018, 11:29 AM
Post#1



Posts: 134
Joined: 30-January 00
From: SoCal


I am getting the dreaded Run-time error 3061 with the following:

sSQL = "INSERT INTO tblDummy1 ([fkPlayerID],[fkGolfRoundID],[GrpNum],[crsHcap],[Flight]) & _
Values(" & cboPlayer1 & "," & Me.fkGolfRoundID & "," & txtGrp & "," & p1crsHcap & ", " & p1Flight & ")"

This is what the Locals Window shows:

: sSQL : "INSERT INTO tblDummy1 ([fkPlayerID],[fkGolfRoundID],[GrpNum],[crsHcap],[Flight]) Values(2398701,110,1,31, C)" : String


If I remove "Flight" from my SQL, it works fine, so obviously that's where the problem is. I'm guessing it's a simple syntax error, I just can't figure out what that is.

All of the data types are integer except "Flight" which is short text data type in my table.

What do I need to change?


Thank you and happy new year to all the good folks who help so many of us on this forum!






Go to the top of the page
 
moke123
post Jan 1 2018, 11:34 AM
Post#2



Posts: 1,202
Joined: 26-December 12
From: Western Ma.,L.I.,N.Y.,Jupiter,Fl.



CODE
Values(" & cboPlayer1 & "," & Me.fkGolfRoundID & "," & txtGrp & "," & p1crsHcap & ", '" & p1Flight & "')"

you need to delimit the string with quotation marks 'p1Flight'
Go to the top of the page
 
SheriDi
post Jan 1 2018, 12:15 PM
Post#3



Posts: 134
Joined: 30-January 00
From: SoCal


Works perfectly!!!


Thank you.
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    21st January 2018 - 03:41 PM