I am using a button to retire a product. I am trying to make it so that the SQL will retire the product depending on which one the user is looking at on the form using the autonumber as the primary key.
I recieve a data type mismatch error when I attempt to run it. Any suggestions on what I may have overlooked?
Dim SQL_Query As String
SQL_Query = "Update Tbl_1 SET Tbl_1.[Retired] = TRUE where Tbl_1.[Autonumber] = """ & Me.Autonumber & """ "
DoCmd.RunSQL SQL_Query
I modified the code below (which works fine) to write the different line above with the only change being the where clause.
Dim SQL_Query As String
SQL_Query = "Update Tbl_1 SET Tbl_1.[Retired] = TRUE where Tbl_1.[ID]= """ & Me.[ID] & """ "
DoCmd.RunSQL SQL_Query
I recieve a data type mismatch error when I attempt to run it. Any suggestions on what I may have overlooked?
Dim SQL_Query As String
SQL_Query = "Update Tbl_1 SET Tbl_1.[Retired] = TRUE where Tbl_1.[Autonumber] = """ & Me.Autonumber & """ "
DoCmd.RunSQL SQL_Query
I modified the code below (which works fine) to write the different line above with the only change being the where clause.
Dim SQL_Query As String
SQL_Query = "Update Tbl_1 SET Tbl_1.[Retired] = TRUE where Tbl_1.[ID]= """ & Me.[ID] & """ "
DoCmd.RunSQL SQL_Query