Solved

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

Posted on 2004-08-30
3
353 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

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…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
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…
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 …

636 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