techsponge
Technical User
I have the following code for a label. when the user clicks the label above a column it will resort the continuous form by the column clicked.
I am getting a Syntax error message on the select statement, although when I paste the SQL into a new query it runs fine?
Begin SQL
Any Ideas?
I am getting a Syntax error message on the select statement, although when I paste the SQL into a new query it runs fine?
Begin SQL
Code:
Me.Form.RecordSource = "SELECT TblMasterGameList.FrmName, TblMasterGameList.TktType, TblMasterGameList.TktBin, TblMasterGameList.TopPays, TblMasterGameList.PurchDate, TblMasterGameList.TktPrice, TblMasterGameList.TktCount, TblMasterGameList.GameName, TblMasterGameList.WashStampNum FROM TblMasterGameList WHERE (((TblMasterGameList.FrmName) Not Like "TPGC*") AND ((TblMasterGameList.TktType)="5W") AND ((TblMasterGameList.TktBin) Is Null) AND ((TblMasterGameList.TktPrice)=1) AND ((TblMasterGameList.CloseDate) Is Null))ORDER BY TblMasterGameList.GameName;"
Any Ideas?
Code:
Private Sub lblName_Click()
'change the recordset
Me.Form.RecordSource = "SELECT TblMasterGameList.FrmName, TblMasterGameList.TktType, TblMasterGameList.TktBin, TblMasterGameList.TopPays, TblMasterGameList.PurchDate, TblMasterGameList.TktPrice, TblMasterGameList.TktCount, TblMasterGameList.GameName, TblMasterGameList.WashStampNum FROM TblMasterGameList WHERE (((TblMasterGameList.FrmName) Not Like "TPGC*") AND ((TblMasterGameList.TktType)="5W") AND ((TblMasterGameList.TktBin) Is Null) AND ((TblMasterGameList.TktPrice)=1) AND ((TblMasterGameList.CloseDate) Is Null))ORDER BY TblMasterGameList.GameName;"
'set the color to red to show the column sort order
Me.lblName.ForeColor = vbRed
'set the color to black to show the column is not sorted
Me.LblDateRec.ForeColor = vbBlack
Me.LblCount.ForeColor = vbBlack
Me.LblTopPay.ForeColor = vbBlack
Me.LblStamp.ForeColor = vbBlack
End Sub