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

Form based on a grouped by query

1
I have a from based on a query that groups students taking the same exams taken in a specific rooms, however I cannot include the primary key as this is unique to each exam. I also have a subform showing the invigilators allocated to each room. Both main form and subform are linked through the Primary key ID (relationship) which cannot be grouped which brings me a parameter query when running the form, how do I solve this please?
Jan 3 '13 #1
3 1591
MikeTheBike
639 Expert 512MB
Hi

This problem is 'solved' by designing the database/relationships correctly!

Your grouped query can return the RoomID, examinationID and/or any day/time period ID as grouped composite primary key (for this query). The invigilator (are they defined in an Invidilator table?) should be allocated to the room/exam/time (defined in a separate joining table!) which would have the same primary key as indicated above, or somthing similar to this.

I assume the students are asigned to the exam/room/time in a similar way?

More information on the DB design is required to be more specific.

HTH

MTB
Jan 3 '13 #2
NeoPa
32,556 Expert Mod 16PB
As Mike says, you need to step back and think about what you actually want before you design your forms. This involves consideration of what you want certainly, but also of how you think you will get to it. I suspect, if you need access to the PK (or any individual data) of the records, that grouping in the query itself would not make much sense.

What may make sense, is aggregating (using GROUP BY on) the query for the main form but ensuring the sub-form shows individual records. In this case though, the linking fields could not involve specific record data such as the PK.
Jan 3 '13 #3
zmbd
5,501 Expert Mod 4TB
Although MiketheBike makes some valid points, there are also pitfalls in agregate queries that even with a properly designed database one will fall prey to.

First, as MikeTheBike pointed out, you did not provide any kind of information about the tables and relationships; thus, one can only ASSUME that the database is mis-designed.

So a few links for you to follow:

A Tutorial for Access

Database Normalization and Table Structures.

11.Aggregate Query Woes

Once you've worked thru these then lets us see the tables.
Jan 3 '13 #4

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

Similar topics

3
by: Jason | last post by:
I am trying to filter records in a primary form based on records in related tables. The data in the related tables is being displayed in the primary form through subforms. To be more specific, I...
2
by: cwhite | last post by:
I'm having problems with a form based query The user makes a selection from a drop box, there are only two choices: Current Former the user makes a choice and clicks the preview report...
4
by: john | last post by:
I created a form via the wizard with 1 main table and 2 one-on-one tables. As i couldn't add a field to the form (a field that I added to the table after creating the form), I googled out that the...
4
by: Deus402 | last post by:
Here is my table design: tblEmployers EmployerID autonum (primary key) EmployerName text tblLocations LocationID autonum (primary key) EmployerID longint (foreign key) LocationAdress text
5
by: SeanCly10 | last post by:
Hi all. I don't want to sound like a complete idiot here, but I'm somewhat limited in my coding knowledge, and I need some advice and help. I'm working on a database that will eventually be used...
1
by: starke1120 | last post by:
Is there a way to open a form based on query type.. Example.. If a certain query result is 1 then open the form to this result.. If the query results are NULL or 0 results, then open open for...
5
by: iChappy | last post by:
I have a query based off of two fields in an Access form: Fiscal Week (user manual inputs #) & Fiscal Year (combo box defaulted to current year however may select other years) The query is a...
8
by: serhii7777 | last post by:
Hello, I am building a database that keeps track of some events. I need to plot the events on a map. In other words, a query returns a number - digit, the number of incidents of a particular kind. I...
15
by: jt196 | last post by:
I'm trying to create an editable form of fulfilled orders on my system and am running into problems with creating a form based on this query. The field that I need to update (invoice number) is...
4
by: dgunner71 | last post by:
All, I have a Parent form where the Record Source is a query based on three tables (tblcustomers, tblEquipment, and tblWorkOrders). The Parent form has a subform based on a 4th table...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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,...
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.