Sorry. Updated code
[CODE lang="b4x" title="Private Sub btnStudentsATT_Click Dim groups As Map groups.Initialize Dim btnATT As Button=Sender Msgbox2Async("Add "& btnATT.Text &" to Attendance?", "Add Attendance", "Yes", "", "No", Null, False) Wait For Msgbox_Result (Result As Int) If Result = DialogResponse.POSITIVE Then lblAttendance.Enabled = False lblScore.Enabled = False lblHelp.Enabled = False lblAdmin.Enabled = False lblHome.Enabled = False btnBack.Enabled = False btnUpdateAttendance.Enabled = True Sid = btnATT.Tag Dim sname As String = btnATT.Text groups.Put(Sid,sname) Starter.sql.ExecNonQuery2("INSERT INTO attendance VALUES (?, ?, ?, ? ,?, ?, ?,null)", Array As Object(Sid, selectedGroup, btnATT.Text, AcYear, txtClassDate.Text, txtClassPeriod.Text, "P")) btnATT.TextColor=xui.Color_Li"]Private Sub btnStudentsATT_Click
Dim groups As Map
groups.Initialize
Dim btnATT As Button=Sender
Msgbox2Async("Add "& btnATT.Text &" to Attendance?", "Add Attendance", "Yes", "", "No", Null, False)
Wait For Msgbox_Result (Result As Int)
If Result = DialogResponse.POSITIVE Then
lblAttendance.Enabled = False
lblScore.Enabled = False
lblHelp.Enabled = False
lblAdmin.Enabled = False
lblHome.Enabled = False
btnBack.Enabled = False
btnUpdateAttendance.Enabled = True
Sid = btnATT.Tag
Dim sname As String = btnATT.Text
groups.Put(Sid,sname)
Starter.sql.ExecNonQuery2("INSERT INTO attendance VALUES (?, ?, ?, ? ,?, ?, ?,null)", Array As Object(Sid, selectedGroup, btnATT.Text, AcYear, txtClassDate.Text, txtClassPeriod.Text, "P"))
btnATT.TextColor=xui.Color_LightGray
Log(Sid)
Log(sname)
Log(groups.Size)
Else
End If
End Sub[/CODE]