hi:
What is happening now is that i stored some value in variables but when it pass the until instruction they become empty:
Private Sub Command25_Click()
Dim tipomov As String
Dim UltimoIMOVFerra As Long
Dim Obra As Long
Dim Armazem As Long
Dim Data As Date
Dim IDMOV As Long
Dim IDObra As Long
Dim IDFerramenta As Long
Dim Quantidade As Long
Obra = Me![IDObra]
Armazem = 2
Data = Me![Data]
IDMOV = Me![IDMovimento]
tipomov = Me![TipoMovimento]
Me![Movimentos e Ferramentas].SetFocus
DoCmd.GoToRecord , , acLast
UltimoIMOVFerra = Forms![Movimentos]![Movimentos e Ferramentas].Form![IDMOVFerra]
DoCmd.GoToRecord , , acFirst
Do Until UltimoIMOVFerra <> Forms![Movimentos]![Movimentos e Ferramentas].Form![IDMOVFerra]
If tipomov = "Saída" Then