ComboBox oddity

newbie4access

Registered User.
Local time
Yesterday, 22:08
Joined
Apr 23, 2015
Messages
25
I have a combo box that I'd like to get data based on specific contact types for the user to choose from - like designer, so the user does not see irrelevant contact types like maker (unless it's a designer & maker).

The good news is, I have made this work in theory, but the bad new is when it comes to the data showing up on the form, it's just blank lines. :banghead:

I'm including several screen shots - I do not know where I went wrong.

Thank you for any assistance.
 

Attachments

  • 01-rowsource-2015-06-10_1106.png
    01-rowsource-2015-06-10_1106.png
    22.3 KB · Views: 107
  • 02 run ok 2015-06-10_1106_001.png
    02 run ok 2015-06-10_1106_001.png
    11.7 KB · Views: 120
  • 04 prop-sheet.jpg
    04 prop-sheet.jpg
    90.1 KB · Views: 104
  • contacts_t.png
    contacts_t.png
    68.2 KB · Views: 109
  • contacttype_t.png
    contacttype_t.png
    25.8 KB · Views: 98
Last edited:
Your query has one column. Your combo box has two columns, and the first one's width is zero. The second one's width is 4", but the query doesn't deliver a second column, so nothing shows up in your combo.

Change ColumnCount to 1, and ColumnWidths to 4"
 
Awesome! That worked great! Thank you!
 
Re: ComboBox oddity / the value you entered isn't valid for this field

However, when I am adding a 2nd combo box made just like the other (Designer) to the same form, I am getting a new error: "the value you entered isn't valid for this field". I am unable to save data to the table via the form (Maker combo box).:banghead:

Thanks.
 

Attachments

  • 2015-06-10_1348.png
    2015-06-10_1348.png
    31.5 KB · Views: 117
What's the BoundColumn of the combo, and the what is the data type of the ControlSource of the control? Sounds like there is a mismatch there, for instance, you might be trying to save a String into a field that is defined in the table as a Long Integer.

What is most common with a combo is to have two columns, the 1) hidden primary key, and 2) visible text, and upon selection of the text, the primary key is saved in the foreign key field of the other table. Consider the two tables . . .
tblCustomer
CustomerID (PK)
Customer

tblOrder
OrderID (PK)
CustomerID (FK)
OrderDate
In this case the Order form might have a combo on CustomerID with a RowSource of . . .
Code:
SELECT CustomerID, Customer FROM tblCustomer ORDER BY Customer
That combo would have a ControlSource = CustomerID, BoundColumn = 1, ColumnCount = 2, and ColumnWidths = 0";4". Selection in the combo saves the hidden bound column CustomerID to the foreign key field in the Order table.

Does that make sense?
 

Users who are viewing this thread

Back
Top Bottom