473,387 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Alter record based on query result?

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
3 6144
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: boonkit | last post by:
I try to get better performance by implementing this: http://dev.mysql.com/doc/mysql/en/alter-table.html "ORDER BY allows you to create the new table with the rows in a specific order. Note...
0
by: Gianfranco | last post by:
Hi, I'm not familiar at access and at VBA either, so I need some help or at least some hint please. I have table "availabledrivers", coming from a query to the table "drivers". Then I have a table...
5
by: Bob | last post by:
Hi, I am using Access 2000 to print out an address book. I have designed the report based on a database whose first record is not blank. In the design there is a one line report header, a onle...
8
by: mark | last post by:
Access2000 How do I write a query that combines the CTC field from each record below into one record? I need to concatenate the CTC field with a separator, like below: ...
3
by: Steven Stewart | last post by:
Hi there, I have posted about this before, but yet to arrive at a solution. I am going to try to explain this better. I have an Employees table and a Datarecords table (one-to-many...
1
by: Craig M | last post by:
Hi, I've created a query that has all calculations needed, and made a report based on this. I have then made a form based on this query. What I would like to do is print only the current...
3
by: Chris | last post by:
Is it possiable to have a iif function in a query where it looks at the next record. for example if I run the query which lists years and if the results in record 2 equals the result in record 1...
7
by: thread | last post by:
Hi all i need to build progression calculator for a record and for this i need to have the possiblity to get the information for the previous record. is it posible to do it or i will need to use...
7
by: ggfota | last post by:
I have problem creating Access (Continuous) Form with indepenent CheckBox for each record. The user should be able to select records that will be processed by VBA based on ChceckBox value. When I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.