D
DavidW
I am trying to find if an existing date has already been entered for a
record through the before update of a textbox. The name of the text box is
"pumpda", the user types in a preffered date to use. What I hope to do is to
stop a duplicated record before they continue and deal with that problem. I
have tried
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[pumpda] = #" & Me!pumpda & "#"
If rs.NoMatch Then
Exit Sub
Else
MsgBox "Message", vbCritical + vbOKOnly, "Duplicate Record Warning"
Cancel = True
DoCmd.Close acForm, ("dateset"), acSaveNo
DoCmd.OpenForm ("resumerecord")
Exit Sub
End If
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
What this does it looks at everything as not a match including date that
dont exist yet. I am tryin to catch only existing dates in the records.
Thanks
David
record through the before update of a textbox. The name of the text box is
"pumpda", the user types in a preffered date to use. What I hope to do is to
stop a duplicated record before they continue and deal with that problem. I
have tried
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[pumpda] = #" & Me!pumpda & "#"
If rs.NoMatch Then
Exit Sub
Else
MsgBox "Message", vbCritical + vbOKOnly, "Duplicate Record Warning"
Cancel = True
DoCmd.Close acForm, ("dateset"), acSaveNo
DoCmd.OpenForm ("resumerecord")
Exit Sub
End If
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
What this does it looks at everything as not a match including date that
dont exist yet. I am tryin to catch only existing dates in the records.
Thanks
David