Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo box

Status
Not open for further replies.

nat35

Programmer
Nov 10, 2002
86
AU
Hi there,
I have cboCompany looks upvalue were stored in a table.
Second cboSupplierName is based on the first selection
and display the names.How to open the form with one of the name of company in cboCompany.When I use onCurrent then cbosupplierName does not display any names.
thanks in advance
 
Create a procedure that filters the cboSupplierName...

Sub FilterSupplierNames()
cboSupplierName.recordsource="";
if not isnull(cboCustomer) then
cboSupplierName.recordsource="Select SupplierName From Suppliers where Customer = '" & cboCustomer & "';"
end if
cboSupplierName.requery
End Sub

Sub cboSupplierName_GotFocus.....
filtersuppliernames
end sub

Sub Form_Open()
filtersuppliernames
end sub

On On
Johnathan Perry
 
Hi nat35,

Can you not build your Supplier selection so that it is not selective when there is no company, like ..

Code:
SELECT SupplierName FROM Suppliers WHERE [Company] Like Iif(IsNull([cboCompany]),"*",[cboCompany])

Enjoy,
Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top