I can't get this code to work.
I have one other request.
When the message box appears, i would like the "racefinishtime" record in this same table to be displayed for this same "racetimingid" and equivalent "racenumber" previously added.
The Racedate is a unique field.
The addition of this duplicate record must not be blocked. I only want a warning messagebox to appear pls.
Is it Possible? Pls assist
Expand|Select|Wrap|Line Numbers
- Private Sub RaceNumber_BeforeUpdate(Cancel As Integer)
- Dim Answer As Variant
- Answer = DLookup("[RaceNumber]", "RacetimingT", "[Racenumber] = " & Me.RaceNumber & " AND [RaceDate]= #" & Me.Racedate & "#")
- If Not IsNull(Answer) Then
- MsgBox "You have entered a duplicate record for (this will appear now for this duplicate entry) Racenumber = 123 with Racefinishtime = 16/11/2011 03:09:31 PM. " & vbCrLf & "Please press enter to continue and add the record and fix error afterwards.", vbCritical + vbOKOnly + vbDefaultButton1, "Duplicate"
- Cancel = True
- 'Me.Undo
- End If
- 'End Sub