can this be done by a query or?

ariansman

Registered User.
Local time
Today, 14:20
Joined
Apr 3, 2012
Messages
157
Student lectures, subjects and locations are stored in a table like this and now we are in record ID number 154.
Code:
ID   studentname    lectureplace       lecturesubject
1         jack           A             politics    
2         steve          A             politics    
3         jack           B             math    
4         steve          A             politics    
5         jack           B             politics    
6         joe            A             politics    
.          .             .                .
.          .             .                .
154       Jane           B            Geography
We know that the next 32 lectured will be presented by jack on politics ,but we don’t know about the exact location(lectureplace). Can we instantly fill the next 32 records with the data that we know, such as student name and subject, but the lectureplace is left blank and it will be filed later when we know about the location? The resultant table will have ID from 155 to 187, stunetname:jack, lecturesubject: politics but the location will be filled later when the place of the presented lecture is known .
Please lets forget if this job makes sense or not, and lets think if this is possible to be done.
Thank you
 
Can't you just make an update query that only updates the values for the certain ID that you want to update?
 
those IDs (155 - 187) have not yet been created yet. they are supposed to be created automatically when the query puts the data in. will this "update query" do that? how can i make an "update query" then?
 
those IDs (155 - 187) have not yet been created yet. they are supposed to be created automatically when the query puts the data in. will this "update query" do that? how can i make an "update query" then?

You can make an append query for (155-187). When you append and leave a column blank you can update that column with an update query.

If you've never created an update or append query before. Just go to youtube and search for access update/append querys and you will quickly get a hand of it!
 
The only way an append query would work for this is if you have some source data to copy. I use append queries to copy "sets" of data. So for example, I might have a database that manages tests. I have tables that define tests and questions for a test. Then I have tables that define Students, TestsTaken, and Answers. When I add a test to TestsTaken, I copy the questionIDs from the questions table and append them to the Answers table so the student has a spot for each answer.

From what you have told us, I don't "see" a source of the data from which you want to copy. If that is true, you will need to write a VBA loop to generate each row and add it. You can't "generate" rows out of thin air with a query.
 

Users who are viewing this thread

Back
Top Bottom