Selected row from table to query

dimsums

New Member
Joined
Jun 29, 2020
Messages
31
Office Version
  1. 365
Platform
  1. Windows
Hi all,
I am trying to transfer a selected row from a table to the next empty row of a query in MS ACCESS.
I wanted to know if this is possible and if so how to go about it.
Any help will be appreciated.
Thank you
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Is this an Access table or an Excel table (I see you mention Access, but you posted this in the Excel forums)?

Note that you really do not "transfer" data directly to a query. The data does not reside at the query level, but at the underlying table level.
If this data does not already currently exist in table that is the source of the query, it needs to be added to that table.
And then it must meet the criteria that the query has (if any), which dictates which rows of data to return.
 
Upvote 0
This is an Access question but I was wondering if anyone with access knowledge could help me out, so i made sure to point it on the title.
The table does have the data from before. but i need it to be transferred to another query table (where all the queries are saved)
 
Upvote 0
This is an Access question but I was wondering if anyone with access knowledge could help me out
OK, we actually have a forum on this site called "Access Questions" (4th one down the list, "Excel Questions" is the first). So there is where you will want to post all Access questions. I have moved this question there.
The table does have the data from before. but i need it to be transferred to another query table (where all the queries are saved)
A query is NOT a table. A query actually doesn't contain any data of its own. It is really like a "filter" that is placed on an existing table (so you cannot/do not store the data at the query level, but rather at the underlying table level). So you could delete all your queries, and nothing will happen to the data in the data tables.
So think of a "query" as a "filter" on an existing data table. You can select which records to return by setting criteria, and you can also do some calculations.

So, if you wanted to show "more" records in a query, you would want to add more "criteria" that will select that record from the table that is the data source of the query.

If you aren't sure how to do that, do the following.
1. Change your query to "SQL View", and copy and paste that SQL code here for us to see.
2. Give us an example of a record that is currently being returned in your query (you should be able to "Copy and Paste" from "Datasheet View" of the query.
3. Show us the "new record" in your table that you want to start showing up in your query.
 
Upvote 0
Thanks for informing me about the Access forum Joe4,
Hoping this explanation below helps
Old Process -
1)
1599597543757.png

This form is filled, the Job No is automatic.
2) it goes into a table query called ALLMAINTENANCE
1599597613407.png


New Process I want to achieve -
1599597656712.png


I want selected rows from the table above to be inserted into ALLMAINTENACE, at the next empty row(in this case it is on top)

PS - the sql of ALLMAINTENANCE displays this -
1599597713739.png



Hopefully this helps.
I will upload the file after figuring how to do it
 
Upvote 0
2) it goes into a table query called ALLMAINTENANCE
There is no such thing as a "Table Query". They are two different objects. No data physically resides in queries. As I said before queries are really just "filters" or "criteria".
ALL Data (and I emphasize the word "ALL"), is stored at the table level.

So the new data is NOT going into a "query". It is going into a Table, and the query is just retrieving the data from the table.

PS - the sql of ALLMAINTENANCE displays this -

SELECT *
FROM MAINT;
So this is telling you all the the query ("filter") is doing. The "*" means all fields. So, it is telling the query to return all records from the MAINT table. The MAINT table is actually where the data resides.
Since that query does not have any Criteria on it, it is returning ALL the records from your MAINT table. So if you open the MAINT table and compare it to your ALLMAINTENANCE query, they should look exactly the same (have the same number of records and fields).

If you want to copy the records over from "TABLE1" to the MAINT table (the table that your ALLMAINTENANCE query pulls from), you could do so with an "Append Query".
Here is information on how to do that: Add records to a table by using an append query

Note that if both tables have a "Autonumber" ID field, you do NOT want to try to copy that over from TABLE1 to the MAINT table, as you cannot map values into an Autonumber field. Access will automatically populate it when you add a new record.

I am trying to transfer a selected row from a table to the next empty row of a query in MS ACCESS.
Another thing to understand, Access is very different than Excel. You can sort your records by any field you want in Access, but the records themselves do not have any "natural" order. Something explain Access tables like this - think of them as a "bag of marbles", all jumbled up. So there is no "set" order to them, or no "new next line". When you want a new record added, think of it as just dropping a new marble into a bag of existing marbles. There is no problem with adding new ones, but there is no pre-determined space (like a blank row) that it goes into.

I am not sure if you are talking over a database from someone else, but here is a word of caution from someone who has been there - Access is MUCH different than Excel, and not nearly as intuitive as Excel. Before you really start messing around with existing databases, or creating your own, I HIGHLY recommend that you educate yourself on two things:
1. Learning how to use Access (via a book, course, on line education, etc) - trust me, this really isn't something you can "figure out" as you muddle through it;
2. Learning about Relational Databases and Database Theory (especially on the Rules of Normalization)

I tried creating my first database when I did the first thing, but not the second (I understood Access, but now how to build a well-designed database). I spent month of frustration spinning my wheels, until somebody told me to read up on Relational Database Design. I had to scrap most of 6 months of work, but once I did it the right way, things worked correctly and smoothly (they still use that database, almost 20 years later). A poorly designed database will make even simple tasks difficult.

There are lots of good articles out there on this (just Google words like "Access database design and normalization").
Here is one to get you started: Relational Database Normalization Basics | Database Solutions for Microsoft Access | databasedev.co.uk
 
Upvote 0
Thank you for your reply Joe4.
You are completely correct, it is very different from Excel so i need to learn alot, and i checked the MAINT table, it did have all the information. I didnt have to run in circles around the queries
 
Upvote 0
You are welcome.
Access is pretty cool, with all the things it can do, but there is a bit of a steep learning curve!
 
Upvote 0
looks like a cross post
 
Upvote 0

Forum statistics

Threads
1,214,648
Messages
6,120,726
Members
448,987
Latest member
marion_davis

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top