by pardon blessings (1 Submission)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 21st February 2006
Date Added: Mon 8th February 2021
Rating: (1 Votes)
the code is supposed to add date of death(dod) and date of birth but when adding new record i what the code to first check and make sure that
API Declarations
Dim tbl As Recordset
Dim wks As Workspace
Dim db As Database
Set wks = DBEngine.Workspaces(0)
Set db = wks.Databases(0)
Set tbl = db.OpenRecordset("tbl", DB_OPEN_DYNASET)
wks.BeginTrans
criteria = "[dod]='" & [txtdod] & "'"
tbl.FindFirst criteria
If tbl![dod] = txtdod Then
MsgBox "date already exists"
txtdod = ""
txtdod.SetFocus
Exit Sub
Else
tbl.AddNew
tbl![dod] = txtdod
tbl![dob] = txtdob
tbl.Update
End If
wks.CommitTrans
End Sub
No comments have been posted about the code is supposed to add date of death(dod) and date of birth but when adding new record i what . Why not be the first to post a comment about the code is supposed to add date of death(dod) and date of birth but when adding new record i what .