function call as event replacement

S

stefan hoffmann

hi,

is it possible to use a function call as event replacement with the form
itself (Me) as parameter?

In a module i have defined the following:

Public Function FormApplyFilter(AForm As Access.Form) As Boolean
AForm.FilterOn = True
End Function

And i like to set a click property for a button like this in the
property editor:

OnClick = "=FormApplyFilter(Me)"

--> stefan <--
 
D

Dirk Goldgar

stefan hoffmann said:
hi,

is it possible to use a function call as event replacement with the
form itself (Me) as parameter?

In a module i have defined the following:

Public Function FormApplyFilter(AForm As Access.Form) As Boolean
AForm.FilterOn = True
End Function

And i like to set a click property for a button like this in the
property editor:

OnClick = "=FormApplyFilter(Me)"

You can't use "Me", because that is available only in VBA code, but you
can use the form's Form property to achieve the same thing:

OnClick = "=FormApplyFilter([Form])"
 
S

stefan hoffmann

hi Dirk,

Dirk said:
OnClick = "=FormApplyFilter(Me)"
You can't use "Me", because that is available only in VBA code, but you
can use the form's Form property to achieve the same thing:
OnClick = "=FormApplyFilter([Form])"

It was obvious to me that Me won't work, but i hadn't thougt of [Form].

Thanks a lot.

--> stefan <--
 

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