Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2007

Tip: Looking for answers? Try searching our database.

Error 3144 - Syntax Error in UPDATE Statement

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
HRE - 09 Jul 2007 19:43 GMT
I am trying to run an UPDATE sql query in a module. I get the 3144
error but I'm not sure where the error is. Any help would be
appreciated.

Thanks

Function UpdateData()

   Dim RS As DAO.Recordset
   Dim DB As DAO.Database
   Dim qdf As QueryDef
   Dim strQryName As String
   Dim CtyName As String
   Dim FirstLine As Integer
   Dim LastLine As Integer
   Dim cty As String
   Dim strSQL As String

   Set DB = CurrentDb
   Set RS = CurrentDb.OpenRecordset("T_CountyLineNumbers")

   With RS
       .MoveFirst
       Do While Not .EOF

           CtyName = ![County]
           FirstLine = ![FirstRow]
           LastLine = ![LastRow]

           strSQL = "UPDATE T_0002_QFR145RA_Phase_2 SET
(((T_0002_QFR145RA_Phase_2.County)=""" & CtyName & """))" & _
           "WHERE (((T_0002_QFR145RA_Phase_2.ID)>=" & FirstLine & ")
And ((T_0002_QFR145RA_Phase_2.ID)<=" & LastLine & "));"

           DoCmd.RunSQL strSQL

'            Set qdf = DB.CreateQueryDef("qryUpdateData", strSQL)
'
'            strQryName = "qryUpdateData"
'
'            DB.Execute "qryUpdateData"
'
'            DB.QueryDefs.Delete qdf.Name
       .MoveNext
       Loop
   End With

   RS.Close
   Set DB = Nothing

End Function
HRE - 09 Jul 2007 20:06 GMT
> I am trying to run an UPDATE sql query in a module. I get the 3144
> error but I'm not sure where the error is. Any help would be
[quoted text clipped - 47 lines]
>
> End Function

Issue resolved. Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.