Hai everyone, I am doing a project on Attendance Monitoring. I have two tables one master table called student and another table called att to store students daily attendance. I have four comboboxes in my form, by selecting the city,area,centre and batch the respective students satisfying this condition has to be displayed in the grid apart from that i have to display another column to mark attendance. I am using datagrid and mark P for present and A for absent. When i finished marking the whole data has to be stored in att table with the current date. The next day again the same class may be selected with the next date and has to be stored again. The problem is i am not able to store each person attendance. Please help me in this regard.
The att table contains fields like Code: Student_ID,Date,Attendance The student table contains fields like Code: Student_ID,City,Area,Centre,Batch,Name etc The code that i have written is like this
Code: Public ac As New ADODB.Connection Public ar As New ADODB.RecordSet
Private Sub Command1_Click()
Set ar = ac.Execute("select student.Student_ID,att.Attendance from student,att where City = '" & Combo1.Text _ & "' AND Area = '" & Combo2.Text & "' AND Centre = '" & Combo3.Text & "' AND Batch = " & Combo4.Text & "") Dim count As Integer count = ar.RecordCount MsgBox count Set DataGrid1.DataSource = ar
Here's the approach I would take. It's been a while using VB so excuse my errors. It the logic that counts here.
I would begin by creating 4 new tables: City, Area, Centre, Batch. Then bind them directly to your combo boxes and loose the form_Load method. Name the combos boxes the same as the tables names.
Then add the following fields to your existing tables:
[Student]
PrimeKey, Student_id, Last_name, First_name, City, Area, Centre, Batch
[Attendence]
PrimeKey, Course_id, Status
[Course]
Course_id, Course_title, Start_date, End_date, Cost, Duration, Instructor
Here is your new code (may need to adjust):
Dim strQuery As String
Public conObj As New ADODB.Connection Public rs As New ADODB.RecordSet ______________________________________
strQuery = "select ALL from Student WHERE City=" & city.Text & "AND Area=" & area.Text & "AND Centre=" & centre.Text & "AND Batch=" & batch.Text & INNERJOIN Attendence.PrimeKey
Private Sub Search_Click() Set rs = conObj.Execute(strQuery) MsgBox rs.RecordCount Set DataGrid.DataSource = rs End Sub
The student_id is joined to the Attendence table by the Primary Key. That will give you the course and the status (P/A). You should now be able to track unlimited number of sessions/dates per student.
I have purchased a Dell desk top computer at a auction and there is an administrative password on...
(More)
I have purchased a Dell desk top computer at a auction and there is an administrative password on it. I need a Window XP professional instillation CD. I
can i get a copy of MYSQL..my e-mail is kelvinngabo@yahoo.com..
am 16yrs and have created sites but...
(More)
can i get a copy of MYSQL..my e-mail is kelvinngabo@yahoo.com..
am 16yrs and have created sites but the login part is difficult.plz help...kevin
I need a to design an application that contain two protein sequences. The second and first sequence...
(More)
I need a to design an application that contain two protein sequences. The second and first sequence is to be compared and find out if the second sequence is present in the first sequence.
i wish to preview a text base report before printing . i used rich text file but the out put is...
(More)
I WISH TO PREVIEW A TEXT BASE REPORT BEFORE PRINTING . I USED RICH TEXT FILE BUT THE OUT PUT IS DISTURBED.. I DO NOT WANT TO USE DATA DESIGNER OR CRYSTAL REPORTS. THE OUTPUT SHOULD BE PREVIEWED ALONG WITH PAGE SETUP & PRINTER CONTROLS. IS IT POSSIBLE TO DO SO ?