20 pts.
 Runtime Error 2147217900 (80040e14) – Syntex Error (Missing Operator) in query expression
Sir, I am using VB6 as fronthand and Access database as backend. Now in my project i want to display only those records which match selected value through combobox. but when executing system giving error as "Runtime Error 2147217900 (80040e14) - Syntex Error (missing Operator)in query expression " My code is as under Private Sub CmdGetBill_Click() '>>> find the bill details '>>> find the bill by Customer Name AddEdit = "" If CmdGetBill.Caption = "&Get Bill" Then cboCompany.Enabled = True Call ClearField cboCompany.BackColor = vbYellow cboCompany.SetFocus CmdGetBill.Caption = "&Find" Else Dim Rs1 As New ADODB.Recordset If Rs1.State = adStateOpen Then Rs1.Close End If Rs1.Open "select * from bill where bill.customer_name = " & cboCompany.Text & "'", Cn, adOpenStatic, adLockReadOnly If Rs1.RecordCount > 0 Then '>>> show details from bill table DtDate.Value = Rs1("invoice_date") TxtLocation.Text = Rs1("location") TxtChalanNo.Text = Rs1("chalan_no") cboCompany.Text = Rs1("customer_name") LblTotalAmount = Rs1("total_amt") Please help me to solve this problem

Software/Hardware used:
ASKED: May 26, 2009  10:09 AM
UPDATED: May 26, 2009  1:39 PM

Answer Wiki:
A single quote is missing before the concatenation of cboCompany.Text: "select * from bill where bill.customer_name = <b>'</b>" & cboCompany.Text & "'", Cn, adOpenStatic, adLockReadOnly
Last Wiki Answer Submitted:  May 26, 2009  1:39 pm  by  carlosdl   63,535 pts.
All Answer Wiki Contributors:  carlosdl   63,535 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _