INSERT SQL works only with hard coded values
Clash Royale CLAN TAG #URR8PPP INSERT SQL works only with hard coded values Cannot insert a variable using INSERT in MS ACCESS. the insert works great when I insert a hard-coded value such as dbs.Execute "INSERT INTO Flights " _ & "(FlightID) VALUES " _ & "('2');" But fails with a variable Private Sub MainSaveBtn_Click() Dim dbs As Database Set dbs = CurrentDb Dim id As Integer id = 20 Debug.Print id dbs.Execute "INSERT INTO Flights " _ & "(FlightID) VALUES " _ & "('id');" dbs.Close End Sub *Flights table has only one Integer colum named FlightID What am i missing here? You are trying to insert the text 'id' into an integer column. – pritaeas 18 mins ago ...