MattS
Nov 10th, 2000, 03:45 PM
Hey all,
I'm trying to make my Datagrid show data based the contents of a combo box. I've got an Adodc set up, and have pointed the DataSource of the Datagrid to the main table in the database I'm using. Here's an example of the code I'm using:
Private Sub cmbProdFamily_Click()
sqlQuery = "SELECT Catalog_Number FROM IES WHERE Brand
= 'Metalux' AND Product = 'Paralux IV'"
Adodc1.RecordSource = sqlQuery
Adodc1.Recordset.MoveLast
Adodc1.Recordset.MoveFirst
Adodc1.Refresh
End Sub
I've used this method sucessfully with a standard Data control and an MSFlexGrid, but when I try to switch the recordsource for the Adodc in this case it generates this error:
"Syntax error in FROM clause"
I'm pretty comfortable with SQL, so what's up?
I'm trying to make my Datagrid show data based the contents of a combo box. I've got an Adodc set up, and have pointed the DataSource of the Datagrid to the main table in the database I'm using. Here's an example of the code I'm using:
Private Sub cmbProdFamily_Click()
sqlQuery = "SELECT Catalog_Number FROM IES WHERE Brand
= 'Metalux' AND Product = 'Paralux IV'"
Adodc1.RecordSource = sqlQuery
Adodc1.Recordset.MoveLast
Adodc1.Recordset.MoveFirst
Adodc1.Refresh
End Sub
I've used this method sucessfully with a standard Data control and an MSFlexGrid, but when I try to switch the recordsource for the Adodc in this case it generates this error:
"Syntax error in FROM clause"
I'm pretty comfortable with SQL, so what's up?