I'm using Access 2003.
I have code that highlights each record selected, based on code that lives in the form's Current event handler and conditional formatting. I also have a button displayed on each record that deletes that record when clicked, but only after displaying a warning.
Problem is that the Current event seems to fire *after* the command button's Clicked event. That means that if the user clicks the Delete button on a record not currently selected, the error message displays, but the highlighted record is not the record to be deleted. This behaviour will tend to confuse the user.
What's the best way to handle this timing issue? I have tried to simply replicate the code in the Current event to the command button's Clicked event, but it doesn't quite work.
Only thing I can think of is to set some type of flag when the user clicks the Delete button, then check for that flag in the Current event. But that seems very klugy. Is there another way?
Thanks.
Wayne
I have code that highlights each record selected, based on code that lives in the form's Current event handler and conditional formatting. I also have a button displayed on each record that deletes that record when clicked, but only after displaying a warning.
Problem is that the Current event seems to fire *after* the command button's Clicked event. That means that if the user clicks the Delete button on a record not currently selected, the error message displays, but the highlighted record is not the record to be deleted. This behaviour will tend to confuse the user.
What's the best way to handle this timing issue? I have tried to simply replicate the code in the Current event to the command button's Clicked event, but it doesn't quite work.
Only thing I can think of is to set some type of flag when the user clicks the Delete button, then check for that flag in the Current event. But that seems very klugy. Is there another way?
Thanks.
Wayne