473,382 Members | 1,689 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,382 software developers and data experts.

Adding and updating records based on results of a query

I have a table Products consisting of the following fields :-

ProductID, ProductName, PriceLevel, UnitPrice

and a query which returns all products with a specific PriceLevel.
What I would like to do is allow the user to copy all products at one
price level returned in the query and add them to the the Products
table with another price level. For example if the user chose 1 and 3,
it would select all products with PriceLevel 1 add them to the
Products table and update their PriceLevel to 3.

I am no expert when it comes to Access but my inclination tells me
that this would be done with code. I would like advice on the code /
query necessary to perform this operation.

Thanks in advance for your help
Nov 12 '05 #1
1 2767
I think you could do it with just queries and some temp (or,
'working') tables.

Just run a query to copy all the items with Price '1' to a temp table
(after first clearing out the temp table).

Run another query to update the Price to '3'.

Run a third query to append the modified records back.
-Matt


On 22 Sep 2003 05:29:37 -0700, al************@granadamedia.com (Alex
Hemingway) wrote:
I have a table Products consisting of the following fields :-

ProductID, ProductName, PriceLevel, UnitPrice

and a query which returns all products with a specific PriceLevel.
What I would like to do is allow the user to copy all products at one
price level returned in the query and add them to the the Products
table with another price level. For example if the user chose 1 and 3,
it would select all products with PriceLevel 1 add them to the
Products table and update their PriceLevel to 3.

I am no expert when it comes to Access but my inclination tells me
that this would be done with code. I would like advice on the code /
query necessary to perform this operation.

Thanks in advance for your help


Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ryan.Chowdhury | last post by:
This is a general question regarding the use of view and stored procedures. I'm fairly new to databases and SQL. I've created a SQL database using an Access Data Project ("ADP") and I'm...
7
by: Foxster | last post by:
in access i have two tables (tblplayer, tblpoints) in tblplayer i have field totalpoint (number) in tlbpoints i have field pointgame (number) the two files are related via idplayer now i made a...
3
by: Nicolae Fieraru | last post by:
Hi All, I have a select query which is based on tblOne and tblTwo. The query selects some of the records in tblOne and tblTwo, based on a Where condition. What I need to do is to change the...
1
by: Chris Jackson | last post by:
I'm a novice Access user and am not sure how to solve the following problem. Any help with the following would be greatly appreciated! I have two tables with identical structures, the first holds...
4
by: Darrel | last post by:
I'm creating a table that contains multiple records pulled out of the database. I'm building the table myself and passing it to the page since the table needs to be fairly customized (ie, a...
6
by: recif20002002 | last post by:
Hello I am trying to update table1 and set a new value with a condition selecting only the results for the element with the specified ID and the first one with the Date field null. The query...
8
by: shumaker | last post by:
I'm wondering if adding an autonumber primary key will improve the performance of a multiuser access database on a network share. I have a website that lists many tips for improving performance of...
3
by: stuart.medlin | last post by:
I have an Access 97 application that has a basic form (Transcript) and subform. The subform has a query as a recordsource that returns records from a table: SELECT DISTINCTROW Transcript.NCID,...
9
by: Rotor | last post by:
Hello again, Problem: I created a query to pull a set of records by workorder number. It works like a champ. However, I need the user to update/edit the records if need be. I am displaying the...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.