Hi,
I have created the below code (similar code to my previous post but in different purpose/event).
The intention of the code is to have an automated value on the field "TotalValue" once the value is added to the field "Date3"
The sequence of adding value to the field is as below:
Add value to fields "Date1", "Date2", "TypeBrand" (likeA, B C..), then waited for sometimes to add the value for field "Date3"
When the value for the field "Date3" is available, Im expecting a generated value for the field "TotalValue" based on the below formula.
I choose the event "change' but it did not work.
Can someone please help me to find the correct event and vba code?
I have created the below code (similar code to my previous post but in different purpose/event).
The intention of the code is to have an automated value on the field "TotalValue" once the value is added to the field "Date3"
The sequence of adding value to the field is as below:
Add value to fields "Date1", "Date2", "TypeBrand" (likeA, B C..), then waited for sometimes to add the value for field "Date3"
When the value for the field "Date3" is available, Im expecting a generated value for the field "TotalValue" based on the below formula.
Private Sub TotalValue_Change()
If Me.TypeBrand = "A" Then
Me.TotalValue = Me.Date3 - Me.Date2
ElseIf Me.TypeBrand = "B" Then
Me.TotalValue = Me.Date3 - Me.Date1
Else
Me.Total = Null
End If
End Sub
I choose the event "change' but it did not work.
Can someone please help me to find the correct event and vba code?