I want something more than the usual crypic message to a user that the entry just made (into a no dups, primary key field) is a duplicate entry...
so, I added this code... but it bounces me out...
Private Sub txtType_BeforeUpdate(Cancel As Integer)
If Len(Nz(Me.txtType, "")) < 1 Then 'check for an entry
If DCount("[type]", "tbeFixtureTypeDetails", "[type]= '" & Me.Type & "'") > 0 Then 'check for an existing match
vmsgtxt = "This fixture type is already being used; please try again"
vmsgtitle = "DUPLICATE FIXTURE TYPE"
Response = MsgBox(vmsgtxt, vbCritical + vbRetryCancel, vmsgtitle)
vType = Me.txtType & "-DUP!"
*** this next line is the one that bounces me
Me.txtType = vType
End If
End If
...
run-time -2147352567 (80020009)
function set to the before... is preventing... saving the data...
any thoughts wouldbe greatly appreciated in advance,
Mark