test if a control has focus? (1 Viewer)

jatfill

Registered User.
Local time
Today, 18:38
Joined
Jun 4, 2001
Messages
150
Hi all,

I was wondering if there is way to built an event based on whether or not a specific button/text control has the focus on that form.

I wanted to add the ActiveX calendar to a series of forms... but as my space is limited, I created a single pop up form with the calendar control that can be called from any form currently.

Once you double click the date, it evaluates which form is open and sets the date value in the desired text box to whichever date is clicked on, then closes the calendar form. I got the "IsLoaded" check for this portion from another post here.

But I want to be able to do this on forms that have more than one date on them, so I'm not even really sure what I need to accomplish this, I assume I need to test which field/button called the procedure... I guess... any thoughts/ideas?

The main idea was to have a single calendar form that can be called and used from every date field within the database... like I said, it works great on single date field forms... thanks in advance!!
 

AlanS

Registered User.
Local time
Today, 18:38
Joined
Mar 23, 2001
Messages
292
See the Access help for the ActiveControl property, which returns the Control object having the focus. Be sure to use error trapping, as an error occurs if this property is referenced when no control has the focus.
 

Users who are viewing this thread

Top Bottom