Get all the videos in this Access VBA collection 100% FREE by signing up at http://vbahowto.com/ms-access-tutorial
In this video I continue to talk about ms access form object items as I demonstrate how to set control values. I also will show how to reference ms access form object items.
This is part 2 of a 3 part video series.
Here I am assigning the “Caption” property of the form based on what is in the “CategoryName” field:
Forms!Categories.Caption = Me.CategoryName
Option Compare Database Private Sub Form_Current() Dim intResult As Integer Forms!Categories.Caption = Me.CategoryName intResult = calculate(6, 6) MsgBox intResult End Sub Function calculate(num1, num2) Dim dblResult As Double dblResult = num1 + num2 calculate = dblResult End Function
Click here for the database and the code: