Results 1 to 5 of 5
  1. #1
    JAPA1972 is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Jan 2019
    Posts
    14

    Field Name of a control

    I have a form bound to a query. Each field in this control is bound to a field in the query. I use the Screen.ActiveControl command to retrieve the control which has the focus, as shown below. How can I retrieve the (query) field name associated with the control which has the focus?





    dim ctr as control
    set ctr =
    Screen.ActiveControl 'now that I know the control with the focus, what is the field name associated with this control?

    Thanks

  2. #2
    msbad1959 is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2019
    Posts
    2
    screen.activecontrol.name

  3. #3
    JAPA1972 is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Jan 2019
    Posts
    14
    Thanks for your reply but your statement retrieves the control name, not the underlying field name in the query bound to my form. They are different in my design.

  4. #4
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,388
    Me.ActiveControl.ControlSource

  5. #5
    JAPA1972 is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Jan 2019
    Posts
    14
    Thanks! It works great!!!!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 01-20-2018, 03:40 PM
  2. Replies: 4
    Last Post: 02-18-2016, 12:06 PM
  3. Replies: 2
    Last Post: 05-28-2015, 12:12 PM
  4. Tab control / add existing field
    By MissVinegar in forum Forms
    Replies: 3
    Last Post: 01-09-2012, 01:03 PM
  5. Replies: 6
    Last Post: 03-14-2011, 09:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums