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  Computers & Networking  Expert
Rating: 81%, 212 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
what is the key to driver detective?

Answer
we have a 115u cpu 943b,stop light is flashing and basp is lit,we have no documentation ,any ideas

Answer
how to creat a system in visual basic like as electronic book system and give example and code... (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 Programming Tools problem:


Related Products & Issues:



Ask our Experts

 

Solve Your Problem Now!
Chat Live with an Expert
Chat Now
Top Programming Tool Experts



Top Computer & Laptop Repairmen
in Beverly Hills, CA
(513) 874-3306
We fix and repair laptop motherboard no video, no...
LaptopOnCall Inc.

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


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

Insert Link
Insert Image
Insert You-Tube clip
Insert List
Insert List
Spell Check

What is this?



Select


close

Add to My Products

Add the things you own to your My Products collection and get product information, solutions to problems, manuals & guides, tips and how-to's, reviews & ratings and local repair service - all in one easy place.


Step 1: Select a category & subcategory

Appliances Cameras Cars Computers Electronics Home Audio TV & Videos Tools
Appliances Cameras Cars Computers Electronics Home Audio TV & Video Tools
 
Step 2: Select a product and click on add
I can't find my product

select

Cancel
close
Success!

Add another product
Close
close
Save This Product

Enter your email address

We will not share your email. Privacy Policy

I agree to the FixYa Terms of Use

 
Send to friends
Your name:
Your email:
Your friends email addresses: (e.g. Julie@email.com)
(Separate email adresses with commas)
Message:
Cancel