SubForm question

G

Guest

Hi

During Run time is their any command or way to keep track of what EVENT currently got triggered in the Form as a string so I can make it easier for 1 generic Error Handeling

I know there is Me.Name which will contain the name of the Form, so something like Me.Event or Me.EventThatJustHappened, something like that
so I can assign a string Variable to the Event that just happened

strEventThatJustHappened = ????

So no matter what Event I put the same code in, will display the appropriate Event, so I dont have to assign each event to a Global String Variable

So for..

Private Sub Form_Load(

if error then would display "Form Load

End Su

Private Sub Form_Unload(cancel As Integer
if here would display "Form_Unload
End Su

Private Sub cmboGender_KeyDown(KeyCode As Integer, Shift As Integer
if here would display "cmboGender_KeyDown
End Su

Any help would be greatly appreciated

Thank you
Jef
 
M

Marshall Barton

Jeff said:
During Run time is their any command or way to keep track of what EVENT currently got triggered in the Form as a string so I can make it easier for 1 generic Error Handeling ?


No. there is no built in way to get the procedure name. If
you really want your error messages to include that kind of
information, you'll have to manage it yourself. One
relatively popular approach is to include a minimal error
handler in every procedure that just calls your generic
handler with the procedure name and error number.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top