hi all
"i'm new to vb programming"
i created empty list box in form with columncount 1
no i have 3 different select statemnt the will have different column result , is there is any way to set the columncount
here is the method
'customerNameCB = comboBox
'SearchB = Button
'productsCB = comboBox
'addressCB = comboBox
Private Sub SearchB_Click()
Me.SearchB = Me.SearchB.DefaultValue
Dim querystirng As String
resultList.ColumnHeads = True
querystirng = ""
If customerNameCB.Enabled = True And (customerNameCB.Value <> customerNameCB.DefaultValue) Then
querystirng = "select le_Order.Order_id, le_Order.OrderDate, orderline.ProductID, Product.Model, Product.[Description] from le_Order,orderline,product where le_Order.Order_id = orderline.orderid And orderline.ProductID = product.ProductID And le_Order.Customer_id ='2'"
ElseIf productsCB.Enabled = True And (productsCB.Value <> productsCB.DefaultValue) Then
querystirng = "select distinct le_Order.Order_id, le_Order.OrderDate, le_customer.CustomerName,le_customer.Adress,orderline.Quantity from le_Order,orderline,product,le_customer where le_Order.Order_id = orderline.orderid And le_Order.Customer_id =le_customer.customer_id And orderline.ProductID = '40';"
ElseIf addressCB.Enabled = True And (adressCB.Value <> addressCB.DefaultValue) Then
querystirng = "select le_Order.Order_id, le_Order.OrderDate from le_order "
End If
If (querystirng <> "") Then
resultList.RowSource = querystirng
End If
Me.SearchB = Me.SearchB.DefaultValue
End Sub
"i'm new to vb programming"
i created empty list box in form with columncount 1
no i have 3 different select statemnt the will have different column result , is there is any way to set the columncount
here is the method
'customerNameCB = comboBox
'SearchB = Button
'productsCB = comboBox
'addressCB = comboBox
Private Sub SearchB_Click()
Me.SearchB = Me.SearchB.DefaultValue
Dim querystirng As String
resultList.ColumnHeads = True
querystirng = ""
If customerNameCB.Enabled = True And (customerNameCB.Value <> customerNameCB.DefaultValue) Then
querystirng = "select le_Order.Order_id, le_Order.OrderDate, orderline.ProductID, Product.Model, Product.[Description] from le_Order,orderline,product where le_Order.Order_id = orderline.orderid And orderline.ProductID = product.ProductID And le_Order.Customer_id ='2'"
ElseIf productsCB.Enabled = True And (productsCB.Value <> productsCB.DefaultValue) Then
querystirng = "select distinct le_Order.Order_id, le_Order.OrderDate, le_customer.CustomerName,le_customer.Adress,orderline.Quantity from le_Order,orderline,product,le_customer where le_Order.Order_id = orderline.orderid And le_Order.Customer_id =le_customer.customer_id And orderline.ProductID = '40';"
ElseIf addressCB.Enabled = True And (adressCB.Value <> addressCB.DefaultValue) Then
querystirng = "select le_Order.Order_id, le_Order.OrderDate from le_order "
End If
If (querystirng <> "") Then
resultList.RowSource = querystirng
End If
Me.SearchB = Me.SearchB.DefaultValue
End Sub