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
cboCompany.BackColor = vbYellow
CmdGetBill.Caption = "&Find"
Dim Rs1 As New ADODB.Recordset
If Rs1.State = adStateOpen Then
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