Public Sub Gerar_Codigo1()
Dim contA As Integer
On Error GoTo MoveError
contA = contA + 1
Data5.RecordSource = "Select*from arqmov"
Data5.Refresh
If Data5.Recordset.RecordCount = 0 Then
contA = 1
ElseIf Data5.Recordset.RecordCount <> 0 Then
Data5.Recordset.MoveMax
contA = contA + Data5.Recordset.Fields("c10")
End If
c10.Text = contA
MoveError:
Dim mgs As String
If Err = 3021 Then
Beep
Exit Sub
End If
End Sub