Question: I’m working on modifying a datagrid to return only data for a specific
record in SalesLogix v6.2.6. I’m receiving the following error when I
attempt to open the datagrid: ” Invalid column name ”
strVal ” at line 20, char1. This is the code I’m using:
Sub AXFormOpen(Sender)
dim strSQL
dim strVal
strVal = Application.GlobalInfo.TempShipFrom
strSQL
=”SELECT DISTINCT A1.ACCOUNT_SHIPFROMID, A1.SHIP_FROM_NO, A1.ADDRESS1,
A1.ADDRESS2, A1.CITY, A1.STATE, A1.POSTALCODE FROM ACCOUNT_SHIPFROM A1
WHERE A1.AccountID = “”‘ & strVal & ‘”””
datagrid1.SQL.Text = strSQL
datagrid1.Refresh
Application.GlobalInfo.
End Sub
Any idea why I’m getting this error?
The
‘ goes into SQL to enclose the acountid. The ” closes the first
part of the string. At the end “‘” adds a single ‘ to the SQL to close
the quote around the ID. This makes a huge difference when parsed for SQL.



