SunQuest
 
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
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  
Old October 27th, 2004, 11:48 AM
Michael Lester Michael Lester is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 55 Michael Lester User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 22 m 39 sec
Reputation Power: 4
Question can you reference a subroutine's name inside the subroutine

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

Reply With Quote
  #2  
Old October 28th, 2004, 12:37 AM
Leslie's Avatar
Leslie Leslie is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Honolulu
Posts: 184 Leslie User rank is Corporal (100 - 500 Reputation Level)Leslie User rank is Corporal (100 - 500 Reputation Level)Leslie User rank is Corporal (100 - 500 Reputation Level)Leslie User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 20 h 29 m 2 sec
Reputation Power: 8
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.

Reply With Quote
  #3  
Old October 28th, 2004, 12:53 AM
Leslie's Avatar
Leslie Leslie is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Honolulu
Posts: 184 Leslie User rank is Corporal (100 - 500 Reputation Level)Leslie User rank is Corporal (100 - 500 Reputation Level)Leslie User rank is Corporal (100 - 500 Reputation Level)Leslie User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 20 h 29 m 2 sec
Reputation Power: 8
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!!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > can you reference a subroutine's name inside the subroutine


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway