dbTalk Databases Forums  

Update all fields from a table with the values of a related table

comp.database.ms-access comp.database.ms-access


Discuss Update all fields from a table with the values of a related table in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Fons Roelandt
 
Posts: n/a

Default Update all fields from a table with the values of a related table - 10-29-2003 , 06:11 AM






Hello,

I have to Update all fields from a table with the values of a related table,
i've tried some querys i found on the internet, but nothing seems to word, i
even tried to lookup the value using dlookup, but even that doesnt seem to
word in a update query.

The query that i think should work is this one:

UPDATE tblOrderLines AS tblO
SET tblO.olArtCode = (
SELECT tblA.artArtCode
FROM tblArticles AS tblA
WHERE (tblA.artArticleID = tblO.olArticleID)
);

But it doen't work, the field olArtCode stays empty after running this
query, i don't get any errors while running the query so i guess the syntax
must be right...

Can anyone tell me what i'm doing wrong?

TNX! Fons



Reply With Quote
  #2  
Old   
MeadeR
 
Posts: n/a

Default Re: Update all fields from a table with the values of a related table - 10-29-2003 , 12:27 PM






Are you sure you're getting a value back from the subquery? And also
- how are you running the update query?

"Fons Roelandt" <f.roelandt (AT) zeelandnet (DOT) nl> wrote

Quote:
Hello,

I have to Update all fields from a table with the values of a related table,
i've tried some querys i found on the internet, but nothing seems to word, i
even tried to lookup the value using dlookup, but even that doesnt seem to
word in a update query.

The query that i think should work is this one:

UPDATE tblOrderLines AS tblO
SET tblO.olArtCode = (
SELECT tblA.artArtCode
FROM tblArticles AS tblA
WHERE (tblA.artArticleID = tblO.olArticleID)
);

But it doen't work, the field olArtCode stays empty after running this
query, i don't get any errors while running the query so i guess the syntax
must be right...

Can anyone tell me what i'm doing wrong?

TNX! Fons

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.