Solved

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

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

809 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