Update a table with details from another

lactaman

New member
Local time
Today, 18:21
Joined
Apr 15, 2008
Messages
4
Hi,

I have not used Access for over 10 years! I am using Access 2000 to look at tracking cow weight over time!

There are 2 tables:
- main table
- weight table

I want to set the main table's January weight to a value from the Animal weight table (logical expression):

UPDATE [main table]
SET [main table].Jan07 = [Animal weight].[Kg]
WHERE [main table].[Line no])=[Animal Weight].[Line no] AND
[Animal weight].[weigh date]= 10/01/2007;

I have tried several times to get this working, but it tends to prompt for the weight to be given as an input.

Any ideas?

many thanks

Lactaman
 
your tables do not appear to be joined, so the query use the text in square brackets as a prompt for input.
 
Your design is not normalized. Also, see Dennis' comment--the query doesn't know what "Animal Weight" is because you didn't tell it.
 
Plus, you don't need to store data that already exists in the database. Just retrieve it with a select query when you need it.
 
Cheers

Many thanks, back up and running now after joining the tables.
 

Users who are viewing this thread

Back
Top Bottom