again bothering, I'm learning a bit of vba, with macros in acces, what I try to do is that when entering the ID this make the corresponding query and show one of the fields in another text box, attached the image of the form and the code
However, when you click on search, the following is displayed.
and if I use a long id it throws the following error error 6 occurred at run time: Overflow
this is the code I'm using
Private Sub consultar_Click()
Dim strSQL As String
Dim ValCustID As Integer
ValCustID = Me.idx.Value
strSQL = "SELECT Modelo " & "FROM Motores " & "WHERE id='" & ValCustID & "';"
Modelox.Value = strSQL
End Sub