Macro condition 'If Form Has Focus'

P

Pete Merenda

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.
 
S

Steve Schapel

Pete,

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

Pete Merenda

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top