S
SJJ via AccessMonster.com
i have a field on a table called booking and the fields are startdate and
starttime.
i put this code onto the form which contains both of these fields.
but it is not working..any suggestion. i want to check for duplicate entering
and prevents from enerting another duplicate date and time.
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "[StartDate] = '" & Me!txtStartDate & "' And [StartTime] = '" &
Me!txtStartTime & "'"
If Not rs.NoMatch Then
MsgBox "Date/Time used"
Cancel = True
End If
End Sub
thanks in advance
starttime.
i put this code onto the form which contains both of these fields.
but it is not working..any suggestion. i want to check for duplicate entering
and prevents from enerting another duplicate date and time.
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
rs.FindFirst "[StartDate] = '" & Me!txtStartDate & "' And [StartTime] = '" &
Me!txtStartTime & "'"
If Not rs.NoMatch Then
MsgBox "Date/Time used"
Cancel = True
End If
End Sub
thanks in advance