Hi everyone. I have a problem with an append query runing from a small Access database and would very much appreciate some input.
The append query from Access is as follows:
INSERT INTO TransferTable ( Name, Surname, Company, Address1, Address2, [Town/City], County, PostCode, Phone, Fax, Email, [Client type] )
SELECT [Clients].[Name], [Clients].[Surname], [Clients].[Company], [Clients].[Address 1], [Clients].[Address 2], [Clients].[Town/City], [Clients].[County], [Clients].[Post Code], [Clients].[PhoneNumber], [Clients].[FaxNumber], [Clients].[Email Address], [Clients].[ClientType]
FROM Clients
WHERE [Name]=[Forms]![Client Form]!Name;
This works up to a point. What it does is send the selected data (based on the name of the client currently being viewed on the Client Form) to the TransferTable which is a link table to a sheet in an Excel workbook.
So far so good.
Each time the query is run though, it inserts the selectd data on the line below the previous run, even if the information that was inserted last time was not saved. So on the first run the query will drop the desired information into row A2 of the TransferTable, then even if that is deleted and the changes to the workbook are not saved, the next time the query is run it goes down to row A3, then A4 and so on. no doubt this is the exact point of an append query, but it's really aggravating me.
What I'd like is a query that will get the data into the same row of the TransferTable each time it is run, since another sheet in the Excel workbook runs some calculations based on the data held in the cells of the TransferTable sheet.
I've tried the SQL editor in Excel, but my very limited knowledge has left me completely frustrated. Does anyone have any ideas how I can achieve this outcome before I go completely nuts ?
I don't mind if the query runs from Excel or Access and I was toying with the idea of using
Cells.Select
Selection.ClearContents in a macro, except I am not a programmer by any stretch of the imagination.
I'm going to post this in the main Excel forum too, since I'm not sure quite where it is most suitable to present this issue.
Thanks in advance to anyone who offers any input.
The append query from Access is as follows:
INSERT INTO TransferTable ( Name, Surname, Company, Address1, Address2, [Town/City], County, PostCode, Phone, Fax, Email, [Client type] )
SELECT [Clients].[Name], [Clients].[Surname], [Clients].[Company], [Clients].[Address 1], [Clients].[Address 2], [Clients].[Town/City], [Clients].[County], [Clients].[Post Code], [Clients].[PhoneNumber], [Clients].[FaxNumber], [Clients].[Email Address], [Clients].[ClientType]
FROM Clients
WHERE [Name]=[Forms]![Client Form]!Name;
This works up to a point. What it does is send the selected data (based on the name of the client currently being viewed on the Client Form) to the TransferTable which is a link table to a sheet in an Excel workbook.
So far so good.
Each time the query is run though, it inserts the selectd data on the line below the previous run, even if the information that was inserted last time was not saved. So on the first run the query will drop the desired information into row A2 of the TransferTable, then even if that is deleted and the changes to the workbook are not saved, the next time the query is run it goes down to row A3, then A4 and so on. no doubt this is the exact point of an append query, but it's really aggravating me.
What I'd like is a query that will get the data into the same row of the TransferTable each time it is run, since another sheet in the Excel workbook runs some calculations based on the data held in the cells of the TransferTable sheet.
I've tried the SQL editor in Excel, but my very limited knowledge has left me completely frustrated. Does anyone have any ideas how I can achieve this outcome before I go completely nuts ?
I don't mind if the query runs from Excel or Access and I was toying with the idea of using
Cells.Select
Selection.ClearContents in a macro, except I am not a programmer by any stretch of the imagination.
I'm going to post this in the main Excel forum too, since I'm not sure quite where it is most suitable to present this issue.
Thanks in advance to anyone who offers any input.