|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
I am trying to create a function (Sub) that will populate a variable (Public string) with the name of the subForm (in Access) that a user has just exited. This will allow me to handle tabbing intellegently from subForm to subForm. The problem is I need to know whether the user is tabbing up the form or down the form (tab or shift-tab) If I know what subForm they are in and what the last subForm exited is then I can change the focus based on which object (text box) is losing focus.
This really shouldn't be this complicated. What I need to do is Private Sub subHS_P_Plan_Exit(Cancel As Integer) StoreLastForm name-of-subForm End Sub Is there any way to pass the string "sub_P_Plan_Exit" to my function "StoreLastForm" Thanks |
|
#2
|
||||
|
||||
|
TRY THIS
You can use the CurrentObjectType property together with the Application object to determine the type of the active database object (table, query, form, report, macro, module, data access page, server view, database diagram, or stored procedure). The active database object is the object that has the focus or in which code is running. |
|
#3
|
||||
|
||||
|
Or just do this
MsgBox "exiting " & Me.ActiveControl.ControlName You could have found that by opening your locals and looking for the subform name. I knew it was bound to be stored somewhere, even though the parent form has focus before the subform exit routine is done. That is what locals is for, folks! You can answer 90% of your own questions if you would all just use the locals, debug, immediate windows!! |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > can you reference a subroutine's name inside the subroutine |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|