Hi,
I have a form with 4 fields. In the first field I will insert a date. When I press TAB and the focus goes to the second field, this field will be filled automatically with first field + 1 month.
The code is the following, and it's working only for the first 2 fields.
Code:
Private Sub Parcela_1_AfterUpdate()
Me.Parcela_2 = DateAdd("m", 1, Me.Parcela_1)
End Sub
---------------------------------------------------------------
Private Sub Parcela_2_AfterUpdate()
Me.Parcela_3 = DateAdd("m", 1, Me.Parcela_2)
End Sub
---------------------------------------------------------------
Private Sub Parcela_3_AfterUpdate()
Me.Parcela_4 = DateAdd("m", 1, Me.Parcela_3)
End Sub
---------------------------------------------------------------
Private Sub Parcela_4_AfterUpdate()
Me.Parcela_5 = DateAdd("m", 1, Me.Parcela_4)
End Sub
---------------------------------------------------------------
So, when I put a date on field 1, I press TAB and field 2 is automatically filled with field 1 + 1 month. But when I press TAB again, field 3 do not get any date. Then I have to type, and when I press TAB field 4 is automatically filled with field 3 + 1 month. But field 5 (which exists) do not get any date. And it goes like this, until field 10.
How can I solve this?