I have a table named "General" which contains fields "CONTRACT" and "EXTENSION" I am trying to find the last entered EXTENSION when viewing any of the CONTRACT record value in the table using some VBA in a on click event button in a form that uses the General table as it's record source. The EXTENSION value is in the third column in the General data table (array element 2).
But I keep getting a 3075 error code. Here is my code...
The first message box generates what appears to be a correct SQL string but the second message box fails to appear and I only get the 3075 error. Any thoughts would be great!
But I keep getting a 3075 error code. Here is my code...
Code:
Dim SQLstring As String
SQLstring = "SELECT * WHERE General.[CONTRACT] = '" & Me.CONTRACT& "' ORDER BY EXTENSION DESC ;"
MsgBox SQLstring
Recordset = CurrentDb.OpenRecordset(SQLstring)
MsgBox "EXTENSION = " & Recordset.Fields(2)