You did not include the attendance table in your most recently posted database, so the queries I created will not work. I went ahead and imported the additional tables from the database you posted into the one I posted last night.
If you run the query QCountByWorkshop and scroll down the list you will see the workshop with the max attendees (74). To extract this from the QCountByWorkshop, we need another query that finds the max value. Essentially this is just one portion of the qryOverallStats
query name: qryGetMax
SELECT Max(QCountByWorkshop.CountOfWCode) AS MaxOfCountOfWCode
FROM QCountByWorkshop;
Now we need to join the above query back to the QCountByWorkshop to get the corresponding WCode. The join needs to be made on via the MaxOfCountOfWCode field of the qryGetMax and the CountOfWCode field of the QCountByWorkshop.
We can also add in the tbl_WS (I had to clean up your key field in that table). I just brought in a couple fields from tbl_WS for illustration purposes. You could include all of them if you wanted.
query name: qryMaxAttendWSDetail
SELECT QCountByWorkshop.WCode, QCountByWorkshop.CountOfWCode, tbl_WS.Workshop, tbl_WS.Type, tbl_WS.Credits
FROM (qryGetMax INNER JOIN QCountByWorkshop ON qryGetMax.MaxOfCountOfWCode = QCountByWorkshop.CountOfWCode) INNER JOIN tbl_WS ON QCountByWorkshop.WCode = tbl_WS.Wcode;
Now, looking at your tbl_WS, you have several normalization issues. First, if a workshop has many sessions (I see the same workshop name repeated in several records). That describes a one-to-many relationship which dictates that the sessions/incidents should be in a separate but related table. This will require you to split your WCode field. Additionally, the sequentially numbered fields LO1, LO2, etc. are an example of repeating groups which is a clear sign that your structure is not normalized. If a workshop has many learning outcomes, that describes a one-to-many relationship. Further, if a learning outcome can apply to many workshops, you have a second one-to-many relationship. When you have 2 one-to-many relationships between the same two entities (workshops & Learning outcomes) you have a many-to-many relationship which is handled with a junction table.
tbl_WS
-pkWSID primary key, autonumber
-WCode (adjusted to remove incident part)
-WorkShop
LearningOutcomes
-pkLOID primary key, autonumber
-Description
-Outcome
tblWSLearningOutcomes
-pkWSLOID primary key, autonumber
-fkWSID foreign key to tbl_WS
-fkLOID foreign key to LearningOutcomes
I typically use an autonumber primary key field in all of my tables and make joins to other tables using that field. Relational databases are generally more efficient when using numeric fields as compared to text fields.
I would recommend getting your tables normalized before going any further. It will save you a lot of headaches in the future.
I have attached the DB with the additional queries above, but I have not modified your tables to correct the normalization issues.