I have 3 filter comboboxes on a form that are bound to a table. the problem is that it saves the id # columns but on the form it shows text. How do I save the text columns to my table. This is what i have so far......
Option Compare Database
Private Sub cboCategory_AfterUpdate()
Dim sType As String
sType = "SELECT [Type].[Type #], [Type].[Type] " & _
"FROM Type " & _
"WHERE [Category ID] = " & Me.cboCategory.Value
Me.cboType.RowSource = sType
Private Sub cboType_AfterUpdate()
Dim sItem As String
From the two combo query samples you provided, ensure the following within the properties window for each ComboBox:
1) Set the Bound Column to 2
2) The Limit To List will set to No. Reset it to Yes. If you don't want to limit to the list then leave at No.
3) Column Count property is set to 2
4) Column Widths property is set to 0";1"
If you don't care to have the Record ID within a column of your ComboBox then leave all the simply get rid of the [Type].[Type #], and the [Item].[ID], from your SQL strings and set the Column Widths property to 1".
Self Taught In ALL Environments.....And It Shows!
As I had mentioned earlier...simply change the Bound Column to 2.
The problem initially lays within the code you used to set the Row Source for the other two Combo Boxes (the Queries).
Because you are referencing the ID number of the previously selected combobox item within your query you need to inform the query where to find it. Since we changed the Bound Column to 2 the box displays text but we're setting the query for the next Combo to look for a Number which it would get if it were Bound to Column 1. So...in your query string we tell the WHERE clause to get the ID number from Column 0 of the ComboBox which is where the ID is stored.