Solved

usage of Property function

Posted on 2002-07-18
2
171 Views
Last Modified: 2010-05-02
Hi

I want to know how to utilize the Property Function.
eg,

Public Property Let AppVersion(sVersion as String)
   lblAppVersion = sVersion
End Property

Where lblAppVersion is a Label control in a form.

What is the above statement trying to achieve ?
I mean, is it like a function or procedure where
we need to call it somewhere in our code.

Pls advice.

Thanks & Rgds
Heng03







0
Comment
Question by:heng03
2 Comments
 

Accepted Solution

by:
Amitabh earned 50 total points
ID: 7164109
you can use property procedures to assign(let) or fetch(get) values from your component.

Suppose you make a component(e.g a dll) "customer" and now you don't want the user to have access to the variable "name" which u r using inside your component at many places. Now what u can do is to add a property cust_name. you must be knowing how to do that...just go to tools -> procedure and add property. give name as cust_name.

soon you will see two procedures let and get in ur window. now when u will make a object of ur component customer like this.

dim myobj as new customer

myobj.cust_name="David"
As soon as u say the above let property procedure is called and it assigns "name" the value "David"

similarly when you say
Text1.text=myobj.cust_name

Get is called and the value stored in variable "name" is fetched.

hope this helps you.
0
 

Author Comment

by:heng03
ID: 7164166
Hi Amitabh

Thanks for your answer.
It is clear to me now.

Rgds
Heng03
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now