Access Show Multiple Records for One Name - ms-access

I currently have a form that allows the user to choose a students name. When the name is selected the form updates to show that particular student's description of the test and the mark they received. Students can take multiple tests. However, the output on the form only shows one test description and one mark even if multiple have been taken. How can I get the form to display multiple descriptions and marks if needed? Below is an example of "Alan" who has taken 2 tests but only one test is output.

Related

How to get combo box selection to fill related fields with data

I have a table [inventory] with inventory items, and a bunch of columns with different information for those. Mainly, part#, description, price. I am trying to create both a purchase order form [POForm] and, and a inventory transactions form [TransactionsForm], but that one thing I've been stuck on is getting a combo box look up I use to select the part# from [inventory], to also fill my fields for description, and price for that item in my form. I need the fields that are filled to be able to have formula's run off of them, and the information to be saved into the table for that form [TransactionsTable], [POTable].
I've tried making my part# combo box include the fields for the description and price, and using =[part#].[column](x) in the other fields as a lookup, and it looks right visually, but that is apparently just a visual of that data, but technically the field is still blank, because those other fields remain empty in the table for that form, and I am not able to run a formula off the price.
As per my understanding and please correct me if I am wrong. you have a form that shows your inventory data Part# Description & price. This form has a combo box that allows you to select a particular part # to view its related record data description and price.
Now you want to click a command button after selecting a particular part # to update your transaction form and POtable.
1.you have to create a query,
2.insert the inventory table in it
3.select append from the query type in the ms access ribbon
4.a window will appear, choose the transaction table as the destination table to append to.
5.double click on the fields that you want to retrieve its data from the inventory table
6.then in the table below in the query itself in the "append to" row you will find drop-down menu including all the fields from the transaction table. choose the corresponding fields. note if the fields have the same name in both tables access will do it automatically.
7.in the criteria row type the following [Forms]![Inventory Form Name]![the name of the field in the form]. do that for each field in the happen query.
8.save the query and name it
9.go-to design view in your inventory form and create a command button, in the click on event creat macro of the following: openquery-->type the append query name
10.save and close macro builder
11.open your form, select part#, click on the button
12.access will ask you to confirm appending process. click ok/yes
13.check your transaction table to confirm that the append process was successfully performed
14.Tip if you do not want the confirmation msg of append to appear, in the click on event go to the macro builder and choose in the ribbon show all actions then in the first line of the macro builder insert setwarnings - NO
the same is to be applied for the POtable.
Anyways, I hope you find this clear and helpful but I have only one concern you do not have to append part description and price in transaction and PO tables as you already have this data in your database in the inventory table. Generally speaking no need to include the same information in multiple tables otherwise you are not benefitting from the idea of a relational database.
I hope I addressed your inquiry.

Consolidate response data from Google Form submissions where the respondents have the same name

I thought I could figure this out, but it seems I can't. Basically, students' information will be input to Google Sheets through Google Forms, but due to my Google Forms having sections, the data of one student appears in different rows. Each student rates 4 subjects, and they each have 4 teachers; the form separates each subject area into sections and Google Sheets places this info into 4 different rows.
I'm trying to consolidate all the data that has an identical name into one row, rather than appearing in 4 different rows. I've recreated what my data currently looks like in this example spreadsheet.
Any help would be much appreciated, this is driving me mental!
You could do it with a lot of VLOOKUP's.
Suppose you put the list of names in A21:A24
=unique(C2:C11)
Then do a lookup on each Name/subject pair in the appropriate column
=ArrayFormula(iferror(vlookup(A21:A24&{"Math","Math","English","English","Science","Science","HSIE","HSIE"},{C2:C11&D2:D11,E2:N11},{2,3,4,5,6,7,8,9},false),""))
Explanation
Maybe the way to explain it is to build it up from the case of one student - one subject to many students - many subjects? This assumes that you've got a list of student's names in A21:A24 and you want to pull out the info for each of them from the original data.
(1) One student, one subject
Hopefully trivial - just provide a reference to the student's report
=E2
(2) Several students, one subject (maths) (Names not necessarily in same order as original list)
Use vlookup to get report against each name
=ArrayFormula(vlookup(a21:a24,C2:E11,3,false))
It's an array formula so that it works through each of the 4 names, finding the first report associated with each. Note that it would pick up a blank for Susan in your data, because the first row with Susan in it contains a blank for maths.
(3) Several students, several subjects
=ArrayFormula(iferror(vlookup(A21:A24&{"Math","Math","English","English","Science","Science","HSIE","HSIE"},{C2:C11&D2:D11,E2:N11},{2,3,4,5,6,7,8,9},false),""))
So here it's looking up pairs like
BobMath BobMath BobEnglish BobEnglish...JimMath JimMath JimEnglish...
(student name + first pair of curly brackets)
in an array (second pair of curly brackets) where the first column is
BobMath
JimMath
SusanScience
...
and pulling out the correct row. It's also got to tell vlookup what column to look in (third pair of curly brackets).
So the first vlookup generated by this would be
vlookup("BobMath",array,2,false)
where array contains
BobMath Cross (several other columns)...
JimMath Blue (several other columns)...
...
BillHSIE (several other columns)... Hair
so it would pick up Cross
and the last vlookup would be
vlookup(BillHSIE,array,9,false)
which would pick up Hair.
Now it doesn't pick up a blank for Susan's maths because the first row it looks in is row 9 and it picks up Tickle from column E.
EDIT
If you then wanted to add some columns which only related to the student and not to any particular subject (like 'student attends counselling') you would need a different approach.
=ARRAYFORMULA(IFERROR(VLOOKUP($A21:$A24,FILTER({$C2:$C11,M2:M11},M2:M11<>""),2,FALSE),""))
This does a lookup as in (2) above but first skips any cells which are blank in the particular column being used for lookup. This formula only works on a single column, but can be pulled across for additional columns.

How to split a table in a report MS Access

How do I split a table into two tables? For example, I have a form of classes (in school) and semi form of students that study in the same class (just first and last name), and made a report for this form that above there are the details of the class and below there is a table of all the students with their name and last name. I wanted to ask how do I split the table to not continue page number 2
if I have alot of students so when the table reach the end of the page it will continue on the other side of the page (small table)?
I don't think you actually want to split the tables if you are designing a report. What you want to do is adjust the report so that the field for Class the students are studying is in a group header. In design mode, click "add a group" and then select the Class field. Then below that is where you will want to put the first and last names in the detail part.
You can also adjust where the pages split and you will need to play around with the design view options to get exactly what you want.
Ultimately, I think you want your report to look something like this:
Geometry
Josetta
Scott
John
Mark
English
Scott
Josetta
History
John
Mark

Passing information from form to form in MS Access

My setup. I have a form that searches through a table names Students containing student information, ID, Name, Home Room, etc. The form text boxes are parameters in a search Query, which then puts its information into a Multiple Items subform.
My goal is to add a button beside each student record on that subform that will do two simultaneous things:
1) Add the student ID to an Incident Occurences table.
2) Open a form to the record just added and edit the values in other fields for that record.
For example, if John Doe decides to draw on his desk, a teacher will be able to search for John Doe, click a button. His student ID goes to the Incident Occurences table, and a form opens up where the teacher can edit the fields for the new record, to add information like what happened, time, etc.
I know how to open a form to a specific record, using the form filter. I also know how to add the student ID to the form. What I don't know is how to get the ID of the record added with an Append Query.
Thanks.
I would do it in VBA. Run the Append query via code, and then open that table and do a MoveLast. You can grab the ID of the last record that matches your student. You can't get the ID of a record until the record is written, so I think that's the only way to do it.

Drilldown using unbound comboboxes with Access "Continuous Form"

There has got to be a simple(r) way to do this.
I have a situation where I am listing parts using continuous forms. The parts listing has things like the part type, manufacturer, part number and the quantity. The list is of the part instances & quantity. I can look the other things up from the instance of the part, so displaying existing parts is no problem, just use a joined query to retrieve the related records or using a DLookup to pull the fields individually.
Type Manufacturer Number Qty
-------------------------------------
Widget Acme 123ab 1
Widget Acme 456 1
Anvil Xyz 12345 2
Llama Northwind 322-12A 1
...
The problem is where the users need to add new parts. There are thousands of different parts, so they can't really choose from a single part number combobox. They want to be able select a part type, manufacturer, and then the part number from three different comboboxes that successively narrow the results in each combobox.
Select a part type >> select a manufacturer who makes one of those types >> select part number of parts of that type by that manufacturer >> enter quantity
Ok, so I can use 2 unbound comboboxes with a DLookup as default, and link them via their Row Source queries. The final combobox is part number with its Row Source filtered - so it only lists the parts from selected type and manufacturer. I have done that before with this kind of situation and it works well.
However I am trying to do this with continuous forms in Access and it is returning the same result for the Dlookup on each record. E.g.
Type Manufacturer Number Qty
-------------------------------------
Widget Acme 123ab 1
Widget Acme 456 1
Widget Acme 12345 2
Widget Acme 322-12A 1
...
Argh, what's going on? My Dlookups seem to be only using the value from the first record. Why?
Is this even a good way to do this? Is there a better pattern to use than drill-down comboboxes on the continuous form? The only other way I can think of to get around this is to use the comboboxes on a "add/edit part" type form where the details are selected in a dialog and then the part number is populated from that. But that seems even more kludgy.
Using unbound controls on a continuous form will only drive you demented, because an unbound control can only refer to the selected record, which could be any of them. I think the pop-up form for adding new records would be quite nice, and easy for the user to understand.