Dim MyTime As Date, DataTime As Date
MyTime = Format(Now, "hh:mm:ss")
DataTime = 'Get the time from your database here
If MyTime > DataTime Then
' Code to Open Door
Else
Code To Close Door
End IF
im having a hard time with SQL, please help with the codes of SQL
and vb, here is the situation, i have a input using textbox "the input is a bar code,
ive just assumed that the code is input in a textbox so even i dont have a bar code
reader ill be able to do it" after ive input a digit in the textbox, example 13420100001
the system will locate if there is a matched of the digit in the database, ive already
done that but here is my problem, after the system located that the digit that is been
inputted in the textbox has the same digit in the database "of course the digit is
registered in a student", the system now will compare the time in and time out of the
student, also the days he/she can enter the room,
for example the student input his/her student number in the system, now the student is registered in the database, the timein is 2:00:00PM, timeout is 3:00:00PM then the days he has class in the room is monday and wednesday only, he inputted this student digit at exactly 2:00:00PM, monday it means he can go in the room, a message box will send the message that he/she can enter the room
Dim WithEvents pol As Timer
Private Sub cmdInput_Click()
Dim myTime As Date, DataTime As Date
myTime = Format(Now, "hh:mm:ss")
DataTime = ""
End Sub
Private Sub cmdNew_Click()
frmInsert.Show
End Sub
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
Adodc1.Refresh
End Sub
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")
End Sub
Private Sub txtInput_Change()
Adodc1.RecordSource = "select * from Login where StudId like '" + txtInput.Text + "'"
Adodc1.Refresh
End Sub
the code above can only determine if a student inserted a valid/ registered student digits