Good day to all, Im creating a computer laboratory admission system, and one of the functions of my program using a bar code reader, this how the system runs, assuming that mr. villa has the bar code and the code is 00123456789 then after you scanned it, it will look into a database which contains hundreds of info, maybe we have 400-500 students at our school, im one of them, after that the program will compare mr.villa's time comlab staying time and the current time
for example, mr. villa scanned at 2:14pm, and his staying time at comlab is 2:00-3:00pm, so it means he is 14minutes late, the program will unlock the door and mr.villa can now enter the computer laboratory,
how can i compare the current time to the time in and time out of the students in the database?
i need to consider also the days, some students have Monday, Wednesday, Friday classes, or Tuesday, Thursday classes and so on...
I have a code but that is only for the input of the code "ive only used textbox to input student number because im still looking for a bar code reader"
my database columns are
StudentName, TimeIn, TimeOut, StudentID "the student number it is unique but i didnt set it as primary key", 1day, 2day, 3day "1day symbolizes the first day of the week a student needs to go to school for example his 1day is monday, 2day is wednesday, 3day is friday, if a student has only 2 days of classes in the comlab im inputting the 3day as none"
ive attached a SS of the database and the current program at vb to give you an idea
Dim WithEvents pol As Timer
Private Sub cmdInput_Click()
Adodc1.RecordSource = "select * from Login where 1day like '" + txtInput.Text + "'"
Private Sub Form_Load()
Form1.BorderStyle = fixedsingle
Set pol = Form1.Controls.Add("vb.timer", "pol", Form1)
With pol: .Interval = 200: .Enabled = True: End With
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\studentdatabase.mdb;Persist Security Info=False"
Adodc1.RecordSource = "Select * from Login"
Set DataGrid1.DataSource = Adodc1
Private Sub Pol_Timer()
txtTime.Text = Format$(Time, "hh:mm:ss AM/PM")
txtDate.Text = Format$(Now, " mmmm dd, yyyy")
txtDay.Text = Format$(Now, "dddd")