Access 2007 front end. Sql Server 2008 R2 back end. ODBC established. Linked tables. I am logged in as SA. I can see all table and all data. I can call up data. This is my first Access to SQL Server database and my first Update query. I wrote the query in Access Query builder. When it was grabbing the data I converted it to a SQL Pass Through Query and edited the SQL Statement so it was correct (I think) and placed it the After Update control of a Combo box. The Variables are calling the correct data as per the watches. I am not getting any error messages from the SQL Statement. But I get an error message when I execute the SQL statement.
Code:
Private Sub TownshipNM_AfterUpdate()
On Error GoTo TownshipNM_AfterUpdate_Error
Dim IntPropID As Integer
Dim StrCountyNM As String
Dim StrTownNO As String
Dim StrTownNM As String
Dim StrCycleNM As String
Dim strVolNO As String
Dim strSQL As String
IntPropID = Me!PropertyID
StrTownNM = Me.[TownshipNM].[Column](0)
StrTownNO = Me.[TownshipNM].[Column](1)
StrCountyNM = Me.[TownshipNM].[Column](2)
StrCycleNM = Me.[TownshipNM].[Column](3)
strVolNO = Me.[TownshipNM].[Column](4)
strSQL = "Update dbo.Property" & " SET County = '" & StrCountyNM & _
"', TownshipNO = '" & StrTownNO & "', TownshipNM = '" & StrTownNM & _
"', Cycle = '" & StrCycleNM & "', Volume = '" & strVolNO & "'" & _
" WHERE PropertyID = ' & IntPropID & ' "
DoCmd.RunSQL strSQL
When I execute the RunSQL command I get the following error
Error 3024 (Could not find file 'C:\Users\Phred\Documents\dbo.mdb'.)
in procedure TownshipNM_AfterUpdate of VBA Document Form_DBO_Property
I don't think it is directing the update to the SQL Server via ODBC. Do I need to direct it somehow to the SQL Server?
It should be directed to the ODBC database K2
Thanks
Phred