I have a form that contains the teacher's name and info
then a sub form inside that main form contains list of records of students under that teacher
in front of each student has boxes that teacher's usually fill with [p] [p] [p] [p] which means the student was present during these periods
I'm trying to make it easy for teachers to just click one button <fil all> the 4 boxes with the following vba code :
Form look like this ..Code:Dim subform As Form Dim ctl As ControlSet subform = Me![AttendanceSubForm].Form For Each ctl In subform.Controls If TypeOf ctl Is TextBox Then If IsNull(ctl.Value) Or ctl.Value = "" Or ctl.Value = "A" Or ctl.Value = "E" Or ctl.Value = "A" Then ctl.SetFocus ctl.Value = "X" End If End If Next ctl
It does not auto fill all the students / records .. only the record that I click on