Discussion Locked

ACCESS 97 - update...

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

How can I update or append from a query into an existing table.

The query is information that has been downloaded from an excel spreadsheet. Each month it will be refreshed with the previous month's figures.

The table denotes specific room ID, room name and a field for each month.

If I use append, the first time for January it imports information perfectly. However, if I use append again for February it just adds additional records for the rooms and figures in february column.

I tried using an update query but have not been able to figure out how to make the query just enter the figures into the specific month's column.

Any help would be greatly appreciated.

5 replies

by peyison

The update query should look something like:

Update tblRooms Inner Join tblRoomValues On tblRoomValues.RoomId = tblRooms.RoomId Set tblRooms.Feb = tblRoomValues.Value;

Where:

* tblRooms is the main table
* tblRoomValues is the table from Excel (either imported or linked)

Change tblRooms.Feb to the name of the field for the month you want to update.

Hope this helps.

by marybar

It was helpful. However, I ended up using an append query to update the table with locations that had not been in table the previous month THEN I used an update query to update the figures for the month.

Thanks for the help!

mb

by nicholasp

Since it works perfectly for the first month, the easierst thing to do is to first run a delete query and delete the entire table, then run your query.

by marybar

This would not have worked because I needed to keep the information I had originally imported for January. Each month I needed to import the figures for the month.

Thanks for responding

This discussion is closed to new replies.