Hi all,
I am trying to update to a SQL table via Access form using ODBC connection.
The form has a selection of unbound fields that once populated I wish to be updated to relevant fields in SQL table.
I have written the attaced code attached to a button at the bottom of the form. i was expecting this to update the records in the SQL table. However, I get the follwoing message
Run Time error '3703' Operation must use an updateable query
I am not entirely sure why this is happening, could be something to do permissions, or could be the way I have setup the query. Would appreciate any help I can get.
Thanks in advance
I am trying to update to a SQL table via Access form using ODBC connection.
The form has a selection of unbound fields that once populated I wish to be updated to relevant fields in SQL table.
I have written the attaced code attached to a button at the bottom of the form. i was expecting this to update the records in the SQL table. However, I get the follwoing message
Run Time error '3703' Operation must use an updateable query
I am not entirely sure why this is happening, could be something to do permissions, or could be the way I have setup the query. Would appreciate any help I can get.
Code:
DoCmd.RunSQL ("UPDATE dbo_EmployeeContact INNER JOIN ((dbo_EmployeeEmergencyContact INNER JOIN ((SELECT [%$##@_Alias].empid, [Surname] & ' ' & [Firstname] AS EmpName FROM (SELECT dbo_EmployeeContact.empid FROM dbo_EmployeeContact GROUP BY dbo_EmployeeContact.empid) AS [%$##@_Alias] INNER JOIN dbo_Employee ON [%$##@_Alias].empid=dbo_Employee.empid GROUP BY [%$##@_Alias].empid, [Surname] & ' ' & [Firstname]) AS [%$##@_Alias] INNER JOIN dbo_Employee ON [%$##@_Alias].empid = dbo_Employee.empid) ON dbo_EmployeeEmergencyContact.empid = [%$##@_Alias].empid) INNER JOIN tblNetworkUsers ON [%$##@_Alias].EmpName = tblNetworkUsers.Name) ON dbo_EmployeeContact.empid = dbo_Employee.empid SET dbo_Employee.Firstname = [Forms]![frmPersonalInformationUpdate]![FName], dbo_Employee.Surname = [Forms]![frmPersonalInformationUpdate]![Surname], dbo_EmployeeContact.address1 = [Forms]![frmPersonalInformationUpdate]![Add1], dbo_EmployeeContact.address2 = [Forms]![frmPersonalInformationUpdate]![Add2]," & _
"dbo_EmployeeContact.address3 = [Forms]![frmPersonalInformationUpdate]![Add3], dbo_EmployeeContact.address4 = [Forms]![frmPersonalInformationUpdate]![Add4], dbo_EmployeeContact.address5 = [Forms]![frmPersonalInformationUpdate]![Add5], dbo_EmployeeContact.postcode = [Forms]![frmPersonalInformationUpdate]![PC], dbo_Employee.dob = [Forms]![frmPersonalInformationUpdate]![DOB], dbo_EmployeeContact.telephone = [Forms]![frmPersonalInformationUpdate]![Landline], dbo_EmployeeContact.mobilePhone = [Forms]![frmPersonalInformationUpdate]![Mobile], dbo_EmployeeEmergencyContact.Name = [Forms]![frmPersonalInformationUpdate]![EmergencyContact], dbo_EmployeeEmergencyContact.Relationship = [Forms]![frmPersonalInformationUpdate]![Relationship], dbo_EmployeeEmergencyContact.Telephone1 = [Forms]![frmPersonalInformationUpdate]![ECTelephone]" & _
"WHERE (((tblNetworkUsers.NetworkUser) = GetNetworkUserName()) And ((dbo_EmployeeContact.mainContact) = True) And ((dbo_EmployeeEmergencyContact.Type) = 'Next of Kin 1')) ")
Thanks in advance