472,121 Members | 1,486 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,121 software developers and data experts.

Filter on repeated IDs

Good day,

I'm creating a db to trace activities done by students where I've created a table with the following columns:
1. StudentID
2. StudentName
3. Birthday
4. Activity
5. ActivityMonth

Then I've Created a form to preview there activities with the same columns

Then I created a textbox where I want to assign a code to filter form as following

I want to write a number for example 3 and I want to filter the form for the students who has participated in 3 or more activities based on their StudentID

so the filter will show all the students who made that number based on their studentID

Many thanks
Nov 26 '20 #1
2 2914
409 Expert Mod 256MB
As each student can have many activities and each activity could be done by many students, this data needs to be in three separate tables to include these fields:

StudentID-PK field
FirstName (as 2 separate fields)

ActivityID - PK field

StudentActivityID - PK field
StudentID - FK field
ActivityID - FK field

The table tblStudentActivities is a junction table linking the other two tables.

Next modify the form record source accordingly with data from each table

The filter can be done in various ways. One is based on an aggregate query where Count(StudentActivityID)>=3
Nov 26 '20 #2
Thanks for the reply, the thing here is that the activities assigned won't be repeated so there is no need to assign IDs to it.

However the students id will be repeated
So I need to filter on it only

As I mentioned earlier I want to assign a code to the Txtbox that will show the repeated IDs on the form

Nov 27 '20 #3

Post your reply

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

Similar topics

2 posts views Thread by virtualweb | last post: by
9 posts views Thread by C#_Help_needed | last post: by

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.