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!

Default Value for combo Box

Status
Not open for further replies.

TimTDP

Technical User
Feb 15, 2004
373
ZA
I have a table consisting of the following fields:
CompanyId - Field type = Auto Number
Company - Field type = Text
Active - Field type = Yes/No

On a form I have a combo box, which includes all the above fields. The first column is field CompanyId and this the combo box's bound column.

When ever the form opens I want the combo box to display the name of the company where Active = Yes.

How do I do this?
 
in the row source of your combo, i think you will have to put something like

SELECT tablename.CompanyID, tablename.Company, tablename.Active WHERE tablename.Active=True
 
But then how do I select other records in the combo box?
 
well u said that when your form opens, you only want to display companies where active is yes..

you will see all the companies that are active..

where else would you want to see the other records??
 
antonyx and I are both trying to understand what you need to accomplish. Will there only be one company that will have active as 'yes' or will there be more than one?
 
Hello Tim,

Just a couple of questions to better answer your question. Is the combo box bound, tied to a field, or unbound. When the value is put in the combo box, do you want the form to move to that record?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top