From: lupis on 26 May 2010 17:00 I am using Access 2007. The problem is that my append query for the subform is not updating the online SQL Server table called dbo_Actions_local. The apend query for the main form though is updating the online table called dbo_Contacts. I am not getting any errror messages when I fire the event. First the query for the mainform is fired with a OpenQuery action and then the one for the subform. I have two append quries that are connected to a form, the main form also includes a subform. I will explain the structure of my tables. Local tables: Contacts (PK=ID) Actions_local(PK=AID, FK=ID) Online SQL Server tables: dbo_Contacts (PK=ID) dbo_Actions_local(PK=AID, FK=ID) Masterform (Contact Details) Subform in Contact Details (frmActions) I am able to update the main form with a append query to the online SQL Server table, but not the subform. The sql for the main form is: INSERT INTO dbo_Contacts ( ID, FirstName, LastName ) SELECT Contacts.ID, Contacts.FirstName, Contacts.LastName FROM Contacts WHERE (((Contacts.ID)=[Forms]![Contact Details].[ID])); The sql for the subfrom is: INSERT INTO dbo_Actions_local ( AID, ActionDate, Stock, ID ) SELECT Actions_local.AID, Actions_local.ActionDate, Actions_local.Stock, Actions_local.ID FROM Contacts INNER JOIN Actions_local ON Contacts.ID=Actions_local.ID WHERE (((Actions_local.AID)=[Forms]![Contact Details]![frmActions].[Form]! [AID]) AND ((Actions_local.ID)=[Contacts].[ID])) Both queries are executed with the same event with each OpenQuery action in a macro for the On Click event of a button
|
Pages: 1 Prev: Assigning work to team 1 and team 2 Next: Refer to SQL statements globally |