By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,344 Members | 1,806 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,344 IT Pros & Developers. It's quick & easy.

Can I reference Form properties from a control's property sheet?

P: n/a
I have a public function that does different stuff based on the parameter
passed to it. I want to use Select Case to identify the parameter like
this:

Public Function SomeFunc(frmName as String)
Select Case frmName
Case "frm1"
do this
Case "frm2"
do that
End Select
End Function

I have an underlined Label control that looks like a hyperlink that I want
to be able to copy and paste onto various forms. If I put

=SomeFunc("frm1")

in the On Click event in the properties sheet, it calls the function and
behaves nicely. But I'd like to have a generic way to implement this.
Something like:

=SomeFunc(Me.Form.Name)

Is there anyway to do this? Can I reference Form properties from the
control's property sheet?

Thanks in advance.
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Me" refers to the current form, so what you want is

=SomeFunc(Me.Name)

not

=SomeFunc(Me.Form.Name)
Darryl Kerkeslager

"deko" <www.clearpointsystems.com@use_contact_form.com> wrote
I have a public function that does different stuff based on the parameter
passed to it. I want to use Select Case to identify the parameter like
this:

Public Function SomeFunc(frmName as String)
Select Case frmName
Case "frm1"
do this
Case "frm2"
do that
End Select
End Function

I have an underlined Label control that looks like a hyperlink that I want
to be able to copy and paste onto various forms. If I put

=SomeFunc("frm1")

in the On Click event in the properties sheet, it calls the function and
behaves nicely. But I'd like to have a generic way to implement this.
Something like:

=SomeFunc(Me.Form.Name)

Is there anyway to do this? Can I reference Form properties from the
control's property sheet?

Thanks in advance.

Nov 13 '05 #2

P: n/a
> =SomeFunc(Me.Name)

That didn't work - but this did:

=SomeFunc([Form].[Name])

Access automatically adds the brackets.

With a reference to Microsoft Internet Controls and some code I can now
paste a hyperlink-looking "Help" label control onto any form and presto -
I've got context-based online help. I looked at a couple of Help add-ins
and other Access Help packages but they just aren't worth the hassle.

Thanks for pointing me in the right direction!
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.