473,624 Members | 1,957 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copy data to another query

Are there anyway to copy rows of records from one query to another
query and then hide the records in source query ? Pls advise. Thanks.

Regards,
Daniel
Nov 12 '05 #1
5 2675
Create a query that joins the two queries and set the appropriate criteria and
you have essentially copied records from one query to another.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com

"Daniel Tan" <da*******@time .net.my> wrote in message
news:6a******** *************** ***@posting.goo gle.com...
Are there anyway to copy rows of records from one query to another
query and then hide the records in source query ? Pls advise. Thanks.

Regards,
Daniel

Nov 12 '05 #2
Records don't live in queries, they live in tables. Queries are just a view
of selected records. So the way to change which of the two queries displays
those records is to change whatever value it is that determines which query
displays the records.

For example, if you have two queries, one of which displays records WHERE
SomeField = 'X' and the other displays records WHERE SomeField = 'Y', then
you change the query that displays a particular record by changing the value
of SomeField in that record from 'X' to 'Y'.

--
Brendan Reynolds

"Daniel Tan" <da*******@time .net.my> wrote in message
news:6a******** *************** ***@posting.goo gle.com...
Are there anyway to copy rows of records from one query to another
query and then hide the records in source query ? Pls advise. Thanks.

Regards,
Daniel

Nov 12 '05 #3
Brendan, do you mean just swap the value of Somefield from one query
to another after i create a new query that comprise of the 2 sub
queries ?

Regards,
Daniel

"Brendan Reynolds" <br******@remov ethisindigo.ie> wrote in message news:<BG******* **********@news .indigo.ie>...
Records don't live in queries, they live in tables. Queries are just a view
of selected records. So the way to change which of the two queries displays
those records is to change whatever value it is that determines which query
displays the records.

For example, if you have two queries, one of which displays records WHERE
SomeField = 'X' and the other displays records WHERE SomeField = 'Y', then
you change the query that displays a particular record by changing the value
of SomeField in that record from 'X' to 'Y'.

--
Brendan Reynolds

"Daniel Tan" <da*******@time .net.my> wrote in message
news:6a******** *************** ***@posting.goo gle.com...
Are there anyway to copy rows of records from one query to another
query and then hide the records in source query ? Pls advise. Thanks.

Regards,
Daniel

Nov 12 '05 #4
No. You can not swap a value from one query to another, because a query does
not contain any values.

To change which records are displayed in a query, you have two choices - you
can change the data (which lives in the table, not in the query), so that it
meets the criteria of a different query, or you can change the SQL statement
that defines the query. Following on from my previous example, if QueryA
displays all records WHERE SomeField = 'X', while QueryB displays all
records WHERE SomeField = 'Y', and I want to change that around, I could do
it as follows ...

Dim db As DAO.Database
Dim qdf As DAO.QueryDef

Set db = CurrentDb
Set qdf = db.QueryDefs("Q ueryA")
qdf.SQL = "SELECT * FROM SomeTable WHERE SomeField = 'Y'"
Set qdf = db.QueryDefs("Q ueryB")
qdf.SQL = "SELECT * FROM SomeTable WHERE SomeField = 'X'"

I might be able to offer a clearer explanation if I had more information -
are we really talking about displaying queries directly, or are we talking
about data displayed in form controls, such as combo boxes or list boxes,
based on those queries? This would, in my experience, by a much more common
requirement - filter one combo box or list box based on the item selected in
another, or allow a user to choose items from one list box and display those
choices in another. Is that what we're talking about here?

--
Brendan Reynolds
"Daniel Tan" <da*******@time .net.my> wrote in message
news:6a******** *************** ***@posting.goo gle.com...
Brendan, do you mean just swap the value of Somefield from one query
to another after i create a new query that comprise of the 2 sub
queries ?

Regards,
Daniel

"Brendan Reynolds" <br******@remov ethisindigo.ie> wrote in message

news:<BG******* **********@news .indigo.ie>...
Records don't live in queries, they live in tables. Queries are just a view of selected records. So the way to change which of the two queries displays those records is to change whatever value it is that determines which query displays the records.

For example, if you have two queries, one of which displays records WHERE SomeField = 'X' and the other displays records WHERE SomeField = 'Y', then you change the query that displays a particular record by changing the value of SomeField in that record from 'X' to 'Y'.

--
Brendan Reynolds

"Daniel Tan" <da*******@time .net.my> wrote in message
news:6a******** *************** ***@posting.goo gle.com...
Are there anyway to copy rows of records from one query to another
query and then hide the records in source query ? Pls advise. Thanks.

Regards,
Daniel

Nov 12 '05 #5
HI Brendan

Yes i would like to display my data on a form. I would like if i
click on a check box then the record would be copied to another table
and source record would disappeared.

Regards,
Daniel
"Brendan Reynolds" <br******@remov ethisindigo.ie> wrote in message news:<TL******* **********@news .indigo.ie>...
No. You can not swap a value from one query to another, because a query does
not contain any values.

To change which records are displayed in a query, you have two choices - you
can change the data (which lives in the table, not in the query), so that it
meets the criteria of a different query, or you can change the SQL statement
that defines the query. Following on from my previous example, if QueryA
displays all records WHERE SomeField = 'X', while QueryB displays all
records WHERE SomeField = 'Y', and I want to change that around, I could do
it as follows ...

Dim db As DAO.Database
Dim qdf As DAO.QueryDef

Set db = CurrentDb
Set qdf = db.QueryDefs("Q ueryA")
qdf.SQL = "SELECT * FROM SomeTable WHERE SomeField = 'Y'"
Set qdf = db.QueryDefs("Q ueryB")
qdf.SQL = "SELECT * FROM SomeTable WHERE SomeField = 'X'"

I might be able to offer a clearer explanation if I had more information -
are we really talking about displaying queries directly, or are we talking
about data displayed in form controls, such as combo boxes or list boxes,
based on those queries? This would, in my experience, by a much more common
requirement - filter one combo box or list box based on the item selected in
another, or allow a user to choose items from one list box and display those
choices in another. Is that what we're talking about here?

--
Brendan Reynolds
"Daniel Tan" <da*******@time .net.my> wrote in message
news:6a******** *************** ***@posting.goo gle.com...
Brendan, do you mean just swap the value of Somefield from one query
to another after i create a new query that comprise of the 2 sub
queries ?

Regards,
Daniel

"Brendan Reynolds" <br******@remov ethisindigo.ie> wrote in message

news:<BG******* **********@news .indigo.ie>...
Records don't live in queries, they live in tables. Queries are just a view of selected records. So the way to change which of the two queries displays those records is to change whatever value it is that determines which query displays the records.

For example, if you have two queries, one of which displays records WHERE SomeField = 'X' and the other displays records WHERE SomeField = 'Y', then you change the query that displays a particular record by changing the value of SomeField in that record from 'X' to 'Y'.

--
Brendan Reynolds

"Daniel Tan" <da*******@time .net.my> wrote in message
news:6a******** *************** ***@posting.goo gle.com...
> Are there anyway to copy rows of records from one query to another
> query and then hide the records in source query ? Pls advise. Thanks.
>
> Regards,
> Daniel

Nov 12 '05 #6

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

Similar topics

42
5755
by: Edward Diener | last post by:
Coming from the C++ world I can not understand the reason why copy constructors are not used in the .NET framework. A copy constructor creates an object from a copy of another object of the same kind. It sounds simple but evidently .NET has difficulty with this concept for some reason. I do understand that .NET objects are created on the GC heap but that doesn't mean that they couldn't be copied from another object of the same kind when...
1
3739
by: Rhanda Zak | last post by:
Hi all, my question is maybe so trivial, that I even could not find it in Google's NG seach, so I annoy you now: I simply want to copy the result of a SELECT query to another table which has the same structure. All I could do until now is showing the result of the query in another form with the query as data source:
0
1933
by: gary b | last post by:
My forehead is sore from beating it against the wall. Can anyone help? I've started drinking again because of this problem! Setup: ContestantTbl = table ('one' side) HorseTbl = table ('many' side) Race1Qry = query based on BOTH tables Race1EditorFrm = Main form (display info originating from
3
40731
by: Melissa Kay Beeline | last post by:
This is driving me crazy!! I'm using MSACCESS, and all I want to do is create a macro/query/anything that will take the data in Column A and copy it into Column B (same table) "Insert into" ALMOST works ... unfortunately it adds the data at the END of Column B ... and I need Column B to be an exact replica of Column A (but with a different name of course). Right now I have my users doing it manually, but I really want to automate it...
3
2192
by: David Altemir | last post by:
I have a table in MS Access 2003 that contains records that I would like to copy to the end of the table. There is one slight deviation from just doing a straightforwared COPY, however, in that I want to append the new records using different value of column 1. Here's an example of what I'm talking about: Values in in Table1 before "copy" operation: Bill, 3200 Palm Blvd
4
2470
by: JIM.H. | last post by:
Hello, I am trying to write the data I got from a web service to my table in SQL Server I need to append the dataset wsDS to the dataset ds and do update. PVS.myWS.Loader load = new PVS.myWS.Loader(); DataSet wsDS=load.WsLoad(); dataGrid1.DataSource=wsDS; string strConn = ConfigurationSettings.AppSettings;
5
5179
by: Hokiecow | last post by:
I'm trying to import specific columns from an excel file (Requirements.xls) into an access table (tblRequirements). Using VBA, I'm able to import the entire excel file into table (tblImportRequirements). Instead of going row by row of (tblImportRequirements) and copying the fields needs to (tblRequirements) it would be faster to just copy the column and over write the other table's column. I'm not sure how to copy a few columns from...
4
6343
by: colmkav | last post by:
Hi, I need to copy a linked table but without keeping the link. ie all the data and settings accept for the link to another db. How can I do this? Colm
3
9233
by: Richnep | last post by:
Hi all, I have tabbed subforms where I need to copy one field value from one subform over to another subform. Although I can run an update query to accomplish this I would like to do it through VBA. sub tables relationships are 1:N with the main table. So the recods display like this in the subform:
0
8238
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8624
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8478
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7164
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4082
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2607
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1786
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1485
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.