I have a combobox called Racedates and a txtbox called Racingdate on a form called CyclistF, to display a date using
i can get it to work with another textfield from the RaceEntry table but not when i use the textbox reading from the combobox.
My code below produce no error, but is does not warn me about the duplication either.
I assume it cant read the "racingdate " textbox.I use beforeUpdate function.
Please assist
Code:
=[racedates].[Column](1)
My code below produce no error, but is does not warn me about the duplication either.
I assume it cant read the "racingdate " textbox.I use beforeUpdate function.
Code:
Dim Answer As Variant Answer = DLookup("raceno", "raceentry", "racedate = #" & Format(Me.RacingDate, "dd/MM/yyyy") & "#") If Not IsNull(Answer) Then MsgBox "Duplicate Race Number Found" & vbCrLf & "This Race No will now be deleted. Use a different one please", vbCritical + vbOKOnly + vbDefaultButton1, "Duplicate" Cancel = True Me.Undo End If
Comment