Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access 2000:Events:Functions - Extracting the "Current Field" name

Posted on 2004-08-30
3
Medium Priority
?
364 Views
Last Modified: 2011-10-03
Is there a way I can get the currently active field's name in a user defined function?  I would like to write a function that executes a specific way given the field's name.  This way I can write a generic function that can be called by several command buttons....
0
Comment
Question by:DCCoolBreeze
  • 2
3 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 11930167
this is a duplicate - do NOT hit the Refresh button on your Browser, but rather the Reload This Question (under page options) on the EE  page.

Post a 0 point request to Community Support to have this DUPLICATE question deleted, and the points refunded.

AW
0
 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 2000 total points
ID: 11930196
oops'orry, did not read the full question, as the title appeared to be a duplicate.

Try:

ActiveControl.Name, or, if you are passing a reference to the control, as a argument:

Private MyFunction(ByRef MyControl as Control) as String
    MyFunction = MyControl.Name
End Function

AW
0
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 11930232
You can retrieve the control that currently has the focus by using:
Screen.ActiveControl

This returns a reference to a Control object. Screen.ActiveControl.Name will give you the control's name, but it's easier just to use the control object.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question