I don't think there is a way to add property in Access. All properties are predefined by Bill Gates. Only him has the power to do so in his next version of Access. You need to pay big bucks to get them!!!
I don't know your use of adding a new property to a form. Can you provide more details on what would you like to accomplish. I bet there are a dozen ways to do every thing (including the wrong ways)in Access. Just let us know!!
I was looking around and this is what I came up with:
Private tmpVar As String
Property Let myProp(myValue As String)
'......... You can place any code here
tmpVar = myValue
End Property
Property Get myProp() As String
'......... You can place any code here
myProp = tmpVar
End Property
Private Sub Command0_Click() 'Form's button
Me.myProp = "Test" 'assign value
MsgBox (Me.myProp) 'display value
End Sub
Property Let is used to set value, and Property Get to retreive value.
Variable tmpVar is used just to exchenge value between Let and Get.
Property Let is procedure which execute when you issue Me.myProp = "some_string" (writting to property), and Property Get is procedure wich execute when you issue SomeVar = Me.myProp (reading from property)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.