Dim MyCommand1 As New OleDbCommand("Select Max (Codigo_Cliente) As Cod_Cli From Clientes", MyConnection) Dim iMax as Integer = Ctype(MyCommand1.ExecuteScalar(),Integer) ...