Limit to list and default for combobox

B

Billy B

I have a combo box on form. The source data comes a table. The combo box
(cboListRet) limit to list property is set to true. My question is it
possible to set the default to "Unknown" if that value is in the table? I
have tried If statements and put unknown in the default property and I get an
error message: "The value you entered is not valid in this field" when I
click on the Tab control the combo box is located.

Thank you for any help.
 
B

Billy B

The Store table has two columns, an StoreID and the StoreName. The combo box
column looks up the store name in the store table and returns the store name
to the combo box but column 1 is the bound column (StoreID). The StoreID
field in tblPlants is a numeric field and the foreign key to the StoreID in
tblStore.

What I am doing is adding a new record. When the user views this field, I
would like Unknown to be displayed (StoreID = 0, (Numeric) StoreName ="
Unknown"). As mentioned before, this is entry already in tblStore.
 
J

Jason

You can't set a string value for a numeric field (assuming StoreID is a
number). Even though text is displayed it is the numeric value that is
stored and then shows the text from the bound table of the combo box. You
need a record in the table where STOREID = 0 and STORENAME = "unknown". Make
the field's default value = 0.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

ComboBox on subform - limit to list can be overridden? 5
Combo Box default value 1
Limit to List 1
NotInList 1
Combo Box - Limit to List 17
Simple Combobox 1
NotInList 3
Limit combo box to list or Null 1

Top