Private Sub OR2_COMPANY_Enter()
Me.TabCtl1.Value = 2 'this makes customer's listbox tab visible
End Sub
Private Sub OR2_COMPANY_Change()
List_Customers.RowSource = "SELECT CUSTOMERS.ID,CUSTOMERS.CUST_ID, CUSTOMERS.CUST_COMP,CUSTOMERS.CUST_NAME, CUSTOMERS.CUST_PHONE FROM CUSTOMERS where (CUSTOMERS.CUST_COMP like '*" & OR2_COMPANY.Text & "*') or (CUSTOMERS.CUST_NAME like '*" & OR2_COMPANY.Text & "*')"
List_Customers.Requery
If List_Customers.ListCount > 0 Then
List_Customers.Enabled = True
Else
List_Customers.Enabled = False
End If
End Sub
|