mercystone
Member
- Local time
- Today, 11:14
- Joined
- Sep 20, 2021
- Messages
- 108
I have a main form and a subform from 2 tables. How can i remove a field from sub form without deleting from a table?
Kindly have a look at this database and look Students examination details. I want to undo changes saved.delete the control
edit: if your subform control has a table as its source object (not a good idea) then best you can do is hide the column (right click on the header), but other users can unhide it again
Private Sub Mark_AfterUpdate()
Static s As String
s = "," & Me.ID & s
Me.Filter = "ID NOT IN (" & Mid(s, 2) & ")"
Me.FilterOn = True
End Sub
Thanks. What if I had saved the subject for the Student and this Student drops a subject at some point, will the same code apply?I've had has a quick look and think what you mean is to hide the row
if that is the case use this code in the mark afterupdate event
Code:Private Sub Mark_AfterUpdate() Static s As String s = "," & Me.ID & s Me.Filter = "ID NOT IN (" & Mid(s, 2) & ")" Me.FilterOn = True End Sub
those records should remain hidden for the period of the session - they will reappear when the form is reopened
IngI don't understand how your app is supposed to work, but I wouldn't think so, you would need something in your tables that your query can filter on to remove it (perhaps a date when the student dropped the subject - dates are better than tickboxes because they tell you when which is often more useful)
Kindly assist me by using the attached database on how to go about itI don't understand how your app is supposed to work, but I wouldn't think so, you would need something in your tables that your query can filter on to remove it (perhaps a date when the student dropped the subject - dates are better than tickboxes because they tell you when which is often more useful)
Good input. Actually I was having an impression that it will be hard to refer to last term's results. I tried using:We don't recommend deleting records once they are created but sometimes you want to do it with rules and xo CJ is explaining how you can leave the data in the database but just not see it on the form.
I think in this case, deleting wouldn't be awful so if you want to actually delete the row, you need to add a delete button to the right of marks to give the user some way to tell you that he wants to delete a subject.
Looking at what you have, there seems to be a missing table. The only time, the Subject would have a marks field is if there was only ever ONE mark entered for the entire course. Usually there are other marks that get entered and the sum/avg of all the marks ends up being the ending grade for the class. So I think you need a fourth table -- StudentSubjectMarks
The FK will be StudentSubhectsID (it is really poor practice to name all your PKs ID. It just makes the relationships impossible to identify unless you have a relationship diagram open in front of you.) Then you need TestDate, TestType, and the Mark. Having a type field allows the teachere to look at exams separately from weekly tests or special projects. It's a nice touch for flexiblity
Or is there any other way to refer to last term results if:Good input. Actually I was having an impression that it will be hard to refer to last term's results. I tried using:
=DlookUp("[Total Marks]","qryGrades","[ID]="&[ID]-1)
But it gives me minus the testdate. I think your suggestion for a fourth table will be very effective.
I have a main form and a subform from 2 tables. How can i remove a field from sub form without deleting from a table?
To get the term i am using thisI didn't notice term in your table so you might want to post the current version. Also term doesn't stand alone anyway. You need SchoolYear AND Term. Add two combos to the form. These are going to be cascading combos. The first will select year and the second will be filtered by year and select term. You can refer to these combos in your RecordSource query OR in the where argument if you are using OpenReport or OpenForm.
Kindly use the attached database and assist me by updatingYou need extra fields in StudentSubjects to record Year and Term to record for any student, subjects for different terms and different years.
Kindly try to implement the instructions yourself. We are happy to advise but you have to at least put some effort into the process.Kindly use the attached database and assist me by updating
Noted. ThanksKindly try to implement the instructions yourself. We are happy to advise but you have to at least put some effort into the process.
Noooooooooo. I am still new in ms access but this forum has really helped me.
What chances this is a school assignment?