I thank all of you for your input. Unfortunately no suggestion workes.
I have created a query using VB6 Query builder which works when run from the Query builder but when placed in my code it produce the following error.
“syntax erroe in FROM CLAUSE”
Here is the Select statement which works in the Query builder.
SELECT tblInfo.fldSuit, tblPayments.fldSuit, tblInfo.fldRCR, tblPayments.fldPDate, tblPayments.fldPaid, tblPayments.fldBalance, tblPayments.fldCashier, tblPayments.fldRecNum, tblPayments.fldVchNum
FROM tblInfo INNER JOIN tblPayments ON tblInfo.fldSuit = tblPayments.fldSuit
WHERE tblPayments.fldSuit = Gsuit;
I know that the problem is in declairing “GSuit” as a string in the select statement. The syntax to do this is where I am falling down.
?To fill the Grid with data that matches the Value in cboPayCombo
Dim strSuit As String
strSuit = cboPayCombo.Text
strQuery = “SELECT tblInfo.fldSuit, tblPayments.fldSuit, tblInfo.fldRCR, tblPayments.fldPDate, tblPayments.fldPaid, tblPayments.fldBalance, tblPayments.fldCashier, tblPayments.fldRecNum, tblPayments.fldVchNum
FROM tblInfo INNER JOIN tblPayments ON tblInfo.fldSuit = tblPayments.fldSuit
WHERE tblPayments.fldSuit = Gsuit”
adoGrid.RecordSource = strQuery adoGrid.Refresh
dtgPayment.ReBind
Please if someone can show me the correct syntax I would be very happy. Thank you.
You can contact me direct at belcredit@yahoo.com