473,387 Members | 1,365 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.

How to move multiple records about same person to one longer record?

I am trying to give a the OGT test to several of the school's students. There are five possible tests that a student may need to take. Some only needs one, and so on. The information that I am getting from the student information system displays the information about each student in one to five rows or records, depending on the number of tests the student has to take. The student's name and ID number are repeated in each row, but the name of the test is unique and allowing one test name in each row. For example Bill Smith might have up to 5 rows with each row ending with one of the following 5 test names: 10R, 10W,10S,10C, 10M. How can I limit the rows to one row for each student with the 5 different test listed at the end of the row. For example:

Bill Smith StudentID 10R 10M 10S 10C
Robert Williams StudentID 10M 10W 10S
Betty Lee StudentId 10M 10s 10c

Thanks.
Oct 13 '16 #1

✓ answered by jforbes

Most people use this function from Allen Browne to merge Rows, Concatenate values from related records It's pretty much the function that Phil is describing.

5 1167
PhilOfWalton
1,430 Expert 1GB
Tad short of information, so I can only give a guide.

I am assuming you hava a table of Students, a table of Tests and a table JoinStudentTest.

On that assumption you, need to create a function that with a recordset based on the JoinStudentTest and the Test. A query passed the StudentID to the function, the function reads all the tests taken by that student and adds each test name to a string, (probably with a comma after each test name). The output of the function is the string (minus the final comma) which is passed back to the query. The query is based only on the Student table.

If you get stuck, let's have details of your tables.

Phil
Oct 14 '16 #2
jforbes
1,107 Expert 1GB
Most people use this function from Allen Browne to merge Rows, Concatenate values from related records It's pretty much the function that Phil is describing.
Oct 14 '16 #3
I followed the suggestions that you both provided. I did get exactly what I was looking for. I used the following expression: Which_Tests: ConcatRelated("[OGT Test]","[Copy Of Copy Of WhoNeedsOGT]","[State Student ID] = """ & [StateStudentId] & """")

But when I went to close everything down and open it back up again, I got the following error message:
"Undefined function in expression"

What happened and what should I do?

Thanks.
Oct 14 '16 #4
I think I found the problem. I located a post on the following website:
http://datapigtechnologies.com/blog/...ons-in-access/

The person was responding to someone else who had a similar problem. The issue is making the mistake of naming the module the same as the function. I am attempting to correct this error.

Thanks.
Oct 17 '16 #5
I was able to finally figure out the various issues I was having. I did get things working for a second on Friday, but then I got an error message saying that there was an undefined function in the expression. I finally found that the module and the function have to have different names. Then I got another error message saying that there was an ambiguous in the expression. The problem was that I had two modules with different names, but the same function with the same name. Once I deleted one of the two, then the error message changed once more. The final error involved a space between the parentheses and the brackets. Once I removed the space, everything worked fine. Thanks for your help.
Oct 18 '16 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: KLAU | last post by:
I have a field that retrieves information from an expression in a query. I have used a DLookup function to get the calculated field from the query. However, the relationship is 1-to-many so one...
4
by: musicloverlch | last post by:
I have a table with multiple records in it. I am being forced to combine multiple records into one record in order to be uploaded to a website, and I only get one record per client. How can I...
5
by: Kaur | last post by:
Hi, I have been successful copying a vba code from one of your posts on how to copy and paste a record by declaring the desired fields that needs to be copied in form's declaration and creating two...
1
by: NumberCruncher | last post by:
Hi All, I am struggling with setting up my first system of tables, forms,and reports, and could use your help! I am setting up a database to keep track of the production of a produced item. The...
7
by: dbnut | last post by:
• I am using Access Trial 2007 in 2003 Mode. • I designed a Form to track what tickets still need to be issued using a split form: ________________________________________ Ticket 14 ...
0
by: qudra | last post by:
Searching multiple records -------------------------------------------------------------------------------- Hi guys. I need ur help. In VB.NET we usually use this code to search the database...
1
by: Jordan M. | last post by:
Hi, Hoping to get some help modifying the following query that I have... TABLE: NAMES ID, FirstName, LastName TABLE: EMAILS ID,LinkID,Email,LastUpdateDate
8
by: jmarcrum | last post by:
Hello all, i have a continuous form that displays about 1000 records and opens when I click a button. When the form opens, the user has the option of checking a checkbox that is located beside...
1
by: spyldbrat | last post by:
I very new to using Access. I am using Access 2007. I am trying to create a Query that shows an employee's weekly scheduled on the same row. I am importing the schedules from Excel which show each...
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: 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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.