im having problm with my date function.
i want to record date in database only one
but my code do not function.
this checks attendance once in a day. date must not double
plz help me.
Sub search()
'search if id registered
With ado
.ConnectionString = connectdb
.RecordSource = "Select * from info where id = '" & Text2 & "'"
.Refresh
If .Recordset.RecordCount > 0 Then
Text3 = .Recordset!id
Text4 = .Recordset!fname
Text5 = .Recordset!lname
Text6 = Date
'goto save record
Call add
Public Sub add()
'save record
adoadd.Refresh
If Text2.Text = adoadd.Recordset.Fields("date") Then
MsgBox "duplicate date", vbInformation, "invalid"
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
Else
With adoadd.Recordset
.AddNew
!id = Text3
!First_Name = Text4
!Last_Name = Text5
!Date = Text6
.Update
MsgBox " save", vbInformation, "Done"
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text6 = ""
End With
End If
DataGrid1.Refresh
End Sub