Home | Microsoft | Visual Basic Enterprise Edition 6.0 (36... | Hai everyone, I am doi...
Microsoft Visual Basic Enterprise Edition 6.0  for PC
Problem for Microsoft Visual Basic Enterprise Edition 6.0 (361-00667)...

Hai everyone, I am doing a project on Attendance




By singhanilth on Jun 27, 2009

" "
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

End Sub

Private Sub Form_Load()

ac.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:v-tablesStudent.mdb;Persist Security Info=False"
ac.CursorLocation = adUseClient

Combo1.AddItem ("CHENNAI")
Combo1.AddItem ("BANGALORE")
Combo2.AddItem ("GILL NAGAR")
Combo2.AddItem ("CHOOLAIMEDU")
Combo2.AddItem ("EGMORE")
Combo2.AddItem ("SOWCARPET")
Combo2.AddItem ("KOTTIVAKKAM")
Combo2.AddItem ("KILPAUK")
Combo2.AddItem ("MOGAPAIR")
Combo3.AddItem ("RANGA NURSERY")
Combo3.AddItem ("V-KIDS")
Combo4.AddItem ("1")
Combo4.AddItem ("2")

End Sub

Solution #1

posted on Jun 27, 2009
Not Rated)

randyprevost

Rank: Wiz 
Rating: 81%, 147 votes
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.
Was this helpful?
Yes
No

Popular Solutions for Microsoft Visual Basic


Questions and Unsolved Problems for Microsoft Visual Basic


Do you recommend Microsoft Visual Basic Enterprise Edition 6.0 (361-00667) for PC?
Answer

Answer
I have purchased a Dell desk top computer at a auction and there is an administrative password on... (More)

Answer
can i get a copy of MYSQL..my e-mail is kelvinngabo@yahoo.com.. am 16yrs and have created sites but... (More)

Answer
I need a to design an application that contain two protein sequences. The second and first sequence... (More)

Answer
i wish to preview a text base report before printing . i used rich text file but the out put is... (More)


Didn't find what you were looking for?

Describe your problem:

Select a Category:





Sponsored Links



Ask our Experts

 

Solve Your Problem Now!
Chat Live with an Expert
Chat Now
Browse popular Problems
More Common Problems
Most Common Problems for:
For Microsoft Visual Basic...:

Top Programming Tool Experts

Rank: Guru Guru  

Solutions: 437
Member Since: October 2009

Experience: Experienced a lot in computer troubleshooting. Knowledgeable about cellular phones.

Ask Me
Find more Programming Tool Experts

Top Computer & Laptop Repair

(877) 934-6198
Send your laptop to us and we will diagnose the...
A+ Rated Oceanside Computer Sales & Service, LLC

(513) 874-3306
We fix and repair laptop motherboard no video, no...
LaptopOnCall Inc.


       
Solve Your Problem Now!
Chat Live with an Expert
Chat Now

X
Continue
When the original poster rates a solution that was given to his own problem, that rating is locked!
X

Are you sure the solution content is Inappropriate?
   
Tech buddies can communicate directly to answer questions. Become a Tech Buddy and have direct access to your favorite expert for FREE!
Insert Link
Insert Image
Insert You-Tube clip
Insert List
Insert List
Spell Check

What is this?



Select