Macro condition 'If Form Has Focus'

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'd like to apply a macro to the toolbar command that allows users to send an
object as an attachment (in Excel). I want the macro to essentially say:

"If Form A has the focus, then send Union Query A (not Form A, because it is
a continuous form). Else, send the selected form."

The Northwind Db includes a VB utility that defines an "IsLoaded" function
as when the form is not in design view. I assume I could create a similar
"GotFocus" function, and then use it in a macro, but don't know how to write
the code to define when a form has focus.

Any suggestions are appreciated.
 
Pete,

Put this is the Condition column of your macro design...
[Screen].[ActiveForm].[Name]="Form A"
 
Thanks Steve. I just saw a similar post, despite earlier searches. It did
the trick.

Steve Schapel said:
Pete,

Put this is the Condition column of your macro design...
[Screen].[ActiveForm].[Name]="Form A"

--
Steve Schapel, Microsoft Access MVP

Pete said:
I'd like to apply a macro to the toolbar command that allows users to send an
object as an attachment (in Excel). I want the macro to essentially say:

"If Form A has the focus, then send Union Query A (not Form A, because it is
a continuous form). Else, send the selected form."

The Northwind Db includes a VB utility that defines an "IsLoaded" function
as when the form is not in design view. I assume I could create a similar
"GotFocus" function, and then use it in a macro, but don't know how to write
the code to define when a form has focus.

Any suggestions are appreciated.
 
Back
Top