I would guess from your code that you get an error when trying to run this code as (unless "Subform1" is a Table or QueryDef), this is not a valid parameter.
Other than that we're still running on little to no information.
You should really be determining for yourself before posting what information is required. We can help if you get it a little wrong, but we can't go through a process of detailed instruction for everyone who posts questions. The overhead would be too onerous.
Obviously code is required so thanks for that. You've hinted at where this code is run from, though the procedure name line would have been more helpful.
We need details about what you have on your form and subform and how the records of the subform are restricted (filtered) if they are. You may also need to provide Table MetaData to help us to understand how your form fits in.
Posting Table/Dataset MetaData - Table Name=tblStudent
-
StudentID; Autonumber; PK
-
Family; String; FK
-
Name; String
-
University; String; FK
-
MaxMark; Numeric
-
MinMark; Numeric
Also, if your code gives an error while compiling or running, we need that too.
Remember, we are happy to help you with our experience, but debugging remotely is very difficult if we don't even have the basic information. I appreciate you may not know exactly what we need, but if you make an attempt to think about what is required (you, after all, are the only one who knows all the details, including what may, or may not, be relevant) we can help you on from there.
This may seem like a lot of trouble to go to, to get a problem solved, and if you feel it's not worth the trouble then we fully understand.