Before Delete acting weird

CedarTree

Registered User.
Local time
Today, 12:36
Joined
Mar 2, 2018
Messages
449
I have let's say 2 records in a subform. Record 1 has username A and Record 2 has username B. While I'm focused on Record 1, I want to test that the record can only be deleted if username = B (but it's A of course). So I test in "before delete confirm" what username is. And referring to Me.username gives me back username B instead of the record I was on. (After all this, Access asks if I'm sure I want to delete the record). What am I doing wrong? Never had this happen before. Using Access 2016. Thanks!
 
Never mind - I'm an idiot. I needed to grab the username in the On Delete event first THEN test in the Before Delete event (the names are confusing... Before sounds to me like it comes before anything else!)
 

Users who are viewing this thread

Back
Top Bottom