the code is supposed to add date of death(dod) and date of birth but when adding new record i what
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
Rate the code is supposed to add date of death(dod) and date of birth but when adding new record i what
(1(1 Vote))
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
the code is supposed to add date of death(dod) and date of birth but when adding new record i what Comments
No comments yet — be the first to post one!
Post a Comment