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
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: