Hi
My desktop runs Windows 10
I am trying to access y and x co-ordinates of a point from an access database nearest to a co-ordinated point on the screen (Cad.Picture1...) .
I get the error Run Time error '-2147217900(80040e14)' ..... Syntax error (comma) in query expression ....
This routine has worked for years and is working on my Windows 10 laptop
Public QryFindPoints As New Recordset
.
..
...
....
QryFindPoints.Open "SELECT Coords.PointName AS PointName, coords.Y as Y, Coords.X as X ,Coords.TextOffY as TextOffY,coords.TextOffX as TextOffX,Coords!TextHeight as TextHeight,Coords!TextAngle as TextAngle,Coords!types as types" _
& " From coords where (Coords.Y between " & Cad.Picture1.ScaleLeft + 20 + CNY & " and " & Cad.Picture1.ScaleLeft + Cad.Picture1.ScaleWidth - 40 + CNY & " and Coords.x between " & Cad.Picture1.ScaleTop - 20 + CNX & " and " & Cad.Picture1.ScaleTop + Cad.Picture1.ScaleHeight + 40 + CNX & " ) and ((trim(Coords.types)= " & TrigType & " or trim(Coords.types)=" & RefType & " or trim(Coords.types)= " & FoundType & " or trim(Coords.types)= " & PlacedType & " or trim(Coords.types)= " & AdoptType & " or trim(Coords.types)= " & CalcType & " or trim(Coords.types)= " & WorkType & " or trim(Coords.types)= " & TempType & " or trim(Coords.types)= " & RejType & " or trim(Coords.types)= " & OtherType & " ))" _
& " ORDER BY (Sqr((Coords.Y- " & YPoint & ")^2+(Coords.X-" & XPoint & ")^2))", CNDatabase, adOpenKeyset, adLockOptimistic
Any help would be greatly appreciated
My desktop runs Windows 10
I am trying to access y and x co-ordinates of a point from an access database nearest to a co-ordinated point on the screen (Cad.Picture1...) .
I get the error Run Time error '-2147217900(80040e14)' ..... Syntax error (comma) in query expression ....
This routine has worked for years and is working on my Windows 10 laptop
Public QryFindPoints As New Recordset
.
..
...
....
QryFindPoints.Open "SELECT Coords.PointName AS PointName, coords.Y as Y, Coords.X as X ,Coords.TextOffY as TextOffY,coords.TextOffX as TextOffX,Coords!TextHeight as TextHeight,Coords!TextAngle as TextAngle,Coords!types as types" _
& " From coords where (Coords.Y between " & Cad.Picture1.ScaleLeft + 20 + CNY & " and " & Cad.Picture1.ScaleLeft + Cad.Picture1.ScaleWidth - 40 + CNY & " and Coords.x between " & Cad.Picture1.ScaleTop - 20 + CNX & " and " & Cad.Picture1.ScaleTop + Cad.Picture1.ScaleHeight + 40 + CNX & " ) and ((trim(Coords.types)= " & TrigType & " or trim(Coords.types)=" & RefType & " or trim(Coords.types)= " & FoundType & " or trim(Coords.types)= " & PlacedType & " or trim(Coords.types)= " & AdoptType & " or trim(Coords.types)= " & CalcType & " or trim(Coords.types)= " & WorkType & " or trim(Coords.types)= " & TempType & " or trim(Coords.types)= " & RejType & " or trim(Coords.types)= " & OtherType & " ))" _
& " ORDER BY (Sqr((Coords.Y- " & YPoint & ")^2+(Coords.X-" & XPoint & ")^2))", CNDatabase, adOpenKeyset, adLockOptimistic
Any help would be greatly appreciated