Solved

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

Posted on 2004-08-30
3
327 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 500 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

803 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