473,386 Members | 1,793 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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
2 1672
"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
> =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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sam Goffin | last post by:
Hi how can I resize my form borders in .NET (either VB or C#)? In one of my programs I want to extend the usual form size at one end (when the user clicks the "Details..." button), so I need...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
8
by: wASP | last post by:
Hi, I'm having a problem referencing the elements within an object after a method of that object (a member function) has been activated with an onsubmit handler: - - - - - - - - ...
2
by: fstenoughsnoopy | last post by:
I have a customer order database and I need to pull a customers information, ie first name, last name, address, city, state, zip, phone, etc, into the oder table. i don't know how to go about...
1
by: gn | last post by:
I have a form that is used for adding, updating and deleting records in a table, everything works fine except that one of the fields uses a list box, this works fine for adding a new record but...
3
by: Deacon Dan | last post by:
I want to be able to keep the current form on the current record. That is, the arrow key, the tab or the enter should not cause the form to go to next record or previous record. Preferably loop...
4
by: rszebras | last post by:
I inherited a database (as a novice at Access) and need to modify it to make it more efficient, i.e., the assignment form needs to autopopulate with the client's name, address, phone number, etc.,...
1
by: Don | last post by:
I'm getting the following exception displayed in the task list at design time for my project: "Code generation for property 'Controls' failed. Error was: 'Object reference not set to an...
10
by: Derek Hart | last post by:
I am going in circles trying to loop through properties on 3rd party controls. For example, I have a textbox that has its maximum length located at MyTextBox.Properties.MaxLength - instead of the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.