By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,677 Members | 1,218 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,677 IT Pros & Developers. It's quick & easy.

Alter record based on query result?

P: n/a
Hi all,
I have managed, using a quite tortuous route, to select certain
records in a UNION query. This is based on the results of other
queries.

Question: how the devil do I change the value of a field in these,
and only these, records? I have tried an update query and VBA all
without success. I know help says that you can't change the values in
a query if the data is from other queries or joined tables, but there
must be a simple way of doing what I want. Mustn't there?

Regards
Richard
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi,
I have managed, using a quite tortuous route, to select certain
records in a UNION query. This is based on the results of other
queries.

Question: how the devil do I change the value of a field in these,
and only these, records? I have tried an update query and VBA all
without success. I know help says that you can't change the values in
a query if the data is from other queries or joined tables, but there
must be a simple way of doing what I want. Mustn't there?
What are you trying to accomplish? The changes should be permanent, so saved
to original tables, or you just want them for some temporary work, like a
report, then you can get rid of them?

If you want just temporary changes, for example to use in a report, you can
create a make table query. Update data in resulting table, use it as you
need, then you can delete the table.

If you want to permanently save changes in your source tables, you might
need to find some key field or fields who unique identify your records in
source tables. Then, based on those key fields, create one or more
recordsets from your original tables, and update data you need on them

If you post more details, I might help you more specifically.

HTH
Bogdan

Regards
Richard

Nov 12 '05 #2

P: n/a
If there's unique ID's returned by the Union query you can create an
Update query
based on the result of the ID's for example:

Update tblSomeTable
Set Field1 = SomeValue
Where tblSomeTable.ID In (Select ID From UnionQuery)

Not sure if that helps - I think we need more specific for any
additional suggestions
ri*****************@ntlworld.com (Richard Williamson) wrote in message news:<62**************************@posting.google. com>...
Hi all,
I have managed, using a quite tortuous route, to select certain
records in a UNION query. This is based on the results of other
queries.

Question: how the devil do I change the value of a field in these,
and only these, records? I have tried an update query and VBA all
without success. I know help says that you can't change the values in
a query if the data is from other queries or joined tables, but there
must be a simple way of doing what I want. Mustn't there?

Regards
Richard

Nov 12 '05 #3

P: n/a
Woohoo! Taht's got it sorted. Note to self: must start doing more in
SQL rather than query design view!

Where would I be without you guys?!

Many thanks
Richard

Me****@ComputerSOSNJ.com (MeadeR) wrote in message news:<32**************************@posting.google. com>...
If there's unique ID's returned by the Union query you can create an
Update query
based on the result of the ID's for example:

Update tblSomeTable
Set Field1 = SomeValue
Where tblSomeTable.ID In (Select ID From UnionQuery)

Not sure if that helps - I think we need more specific for any
additional suggestions
ri*****************@ntlworld.com (Richard Williamson) wrote in message news:<62**************************@posting.google. com>...
Hi all,
I have managed, using a quite tortuous route, to select certain
records in a UNION query. This is based on the results of other
queries.

Question: how the devil do I change the value of a field in these,
and only these, records? I have tried an update query and VBA all
without success. I know help says that you can't change the values in
a query if the data is from other queries or joined tables, but there
must be a simple way of doing what I want. Mustn't there?

Regards
Richard

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.