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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

null combobox then point to particular field in database

Status
Not open for further replies.

alifyag

MIS
Apr 15, 2002
18
US
hi,
i have a combobox on which i have to carry out a sort.
if the combo box is left blank by the user ( that is he does not select anything from the drop down list) then i want the form to be sorted by the CompanyName field in my database. pleeease help.
i tried writing code in the after update event of the combo box but withoout much luck.
alifya
 
Try using two fields in your sort criteria. The first field is driven by the combobox. The second field is the hard coded CompanyName field. When the user does not select anything from the combobox, the first sort field won't do anything and the second, CompanyName field will effectively sort the query. When the user does select a field from the combo box, the query will be sorted by that field first, and then by the CompanyName field.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top