syntax error

samotek

New member
Local time
Yesterday, 21:36
Joined
Aug 14, 2007
Messages
7
I have a syntax error in my folloiwng code. Would you help me to fint it ?
Dim StrSQL As String
StrSQL = "DELETE tblEstate.*Houses FROM tblEstate WHERE (((tblEstate.Houses.Value) Not In (SELECT Max(tblEstate.Houses.Value) AS MaxOfValue FROM tblEstate.Houses)))"
CurrentDb.Execute StrSQL
End Function
 
I think your code should be as follows

Code:
Dim StrSQL As String
StrSQL = "DELETE tblEstate.Houses FROM tblEstate WHERE (((tblEstate.Houses.Value) Not In (SELECT Max(tblEstate.Houses.Value) AS MaxOfValue FROM tblEstate.Houses)))"
CurrentDb.Execute StrSQL
End Function

I am not sure about the rest of your SQL string. It would be best to go to the SQL view of the Query designer and check that it is valid. I am doubtful in particular about tblEstate.Houses.Value. I don't think you need the value as SQL can only access the value and not any of the other properties.
 

Users who are viewing this thread

Back
Top Bottom