Form Event 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
Jeff
 
H

help

the access form have some Properties ,you can use VBA code list it or set
it.

Function setEvent()
Dim p As Property

For Each p In Forms("formname").Properties

If Left(p.Name, 2) = "On" _

Or Left(p.Name, 5) = "After" _

Or Left(p.Name, 6) = "Before" Then

p.Value = "=msgbox('" & p.Name & "')"

End If

Next p

End Function







Jeff said:
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.
 
G

Guest

Hi,

Thank you for the reply, but this is not what I am looking for

I just used those 3 Events as an example

What if I have 20 different Events in the Form

What I would like is some generic way to determine which Event is Currently being triggered in the Form

Thnx
Jeff
 

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