Have you ever wanted to push a variable onto a form without using a
tag? Property functions let you create custom properties for forms or class
models. Use PropertySet, PropertyGet, and PropertyLet statements to manipulate
custom properties.
For example, you want to send a key value to a form so that the key
is there in time for an SQL query to use it in a condition. Include a variable
declaration for the property as a form-level variable:
Private msKey as String
Then add two procedures for PropertySet and PropertyLet for the form:
Public Property Let GetKey(vNewValue)
msKey = vNewValue
End Property
Public Property Get GetKey()
GetKey = msKey
End Property
You can now set the property from elsewhere by using:
Form1.GetKey = "David"
In your form, use the variable you declared for any usage in your code.
Property Procedures can be a bit more complex. But, the point is that the
VB4 has become much more adaptable to your needs. Customize it to fit.