i'm not understanding very well, but i will send my function and then maybe
you can help me, if you want:
Function primeiroano()
Dim x, y, t
Dim anoa As Long
Dim adaqui As String
Dim dias As String
Dim perc As String
Dim vcomp As String
Set anoa = Form_Inventário.Tanoactual.Value
Set adaqui = Form_Inventário.Tanodataaquisicao.Value
Set dias = Form_Inventário.Tcaixadias.Value
Set perc = Form_Inventário.Tpercentagem.Value
Set vcomp = Form_Inventário.Tvalorcompra.Value
Set t = Form_Inventário.T1ano.Value
If anoa = adaqui Then
x = (dias / 365)
y = (perc * vcomp)
t = x * y
Else
t = "0"
End If
End Function
The name of the fields are in portuguese, os don't worry because of the
names, if ou don't understand. the question is the same i put before. how can
i get the values from the fields and calculate them and set in the T1ano
field (= vairant t)